• Post Reply Bookmark Topic Watch Topic
  • New Topic

Write [alt]-[enter] key combination to file

 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how would I create a string with the <alt>-<enter> key combiniation in the middle of it which I can then write out to a file? Would it be as simple as outputing the unicode characters for <alt> and then <enter>?
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't make sense to write a key combination to a file. It only makes sense to write characters (or bytes) to a file. Could you tell us why you want to do this?
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alt and enter are not characters,

enter or return quite often maps to "\n",

http://www.leepoint.net/notes-java/io/10file/sys-indep-newline.html
(re:content in the link, Mac OS X is Unix)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!