Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
General Discussion
Other
Sinchai
Input number by key board?
in
General Discussion
•
Other
•
2 months ago
I want to get some number to variable by keyboard. Can I do?
Please example.
Thank.
1
Replies(2)
tfguy44
Re: Input number by key board?
2 months ago
int num= 0;
String str_num = "";
void keyPressed(){
if( key >= '0' && key <= '9' ){
str_num += key;
}
if( key == ENTER || key == RETURN ){
num = int( str_num );
str_num = "";
println( num );
}
}
Untested code. Something like this.
Leave a comment on tfguy44's reply
Sinchai
Re: Input number by key board?
2 months ago
Thank :tfguy44
My test, add empty function draw() in your example, OK.
Leave a comment on Sinchai's reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to Sinchai's question
Top
Reply
{"z4106057":[25080000002304255],"z28646388":[25080000002302260,25080000002307015]}
Statistics
2
Replies
244
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
SPAM – What can we do about it?
multiple audio inputs .(more than 1...
Creating a HDR image
how to measure rotational offset of...
Converting key into integer value