• Post Reply Bookmark Topic Watch Topic
  • New Topic

Control-Enter  RSS feed

 
sasuke sarutobi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I detect "control-enter" key event in JTextArea?
TA
Sasuke
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sasuke,
here is the small piece of code.

Note that the getModifiers() function returns the code of the mask key( cntrl/shift/alt) that was pressed during the KeyEvent.
so we can use
ke.getModifiers()== KeyEvent.CTRL_MASK
and
ke.getKeyCode() == KeyEvent.VK_ENTER
to find out whether cntrl+enter was pressed by the user.

hope this is clear
regards
deekasha
 
sasuke sarutobi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
sasuke
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!