Comp Sci Stop Input with Control Z: Java Loop

  • Thread starter Thread starter Punkyc7
  • Start date Start date
  • Tags Tags
    Java Loop
AI Thread Summary
To stop user input in a Java program using Control Z, one can implement a loop that checks for specific keystrokes. The discussion highlights the need to "trap keystrokes" to detect when Control Z is pressed. Several examples and resources are available online to guide users through this process. Participants emphasize the importance of handling exceptions and ensuring the program can gracefully exit the input loop. Utilizing these techniques will allow for effective user input management in Java applications.
Punkyc7
Messages
415
Reaction score
0
I am having the user enter a bunch of strings and when the user wants to stop entering them I want him to use control z to stop the input. The only problem is I can't seem to figure how to make that happen, does anyone have any suggestions?
 
Physics news on Phys.org
There should be lots of examples on line you can follow. The phrase you want to Google is 'trap keystrokes'
 
Ok thank you, I didnt know what to look for
 

Similar threads

Replies
12
Views
2K
Replies
8
Views
3K
Replies
1
Views
1K
Replies
3
Views
6K
Replies
7
Views
2K
Replies
1
Views
2K
Replies
6
Views
4K
Replies
3
Views
8K
Replies
5
Views
3K
Back
Top