
HarryAchterdeur
Novice
Oct 3, 2012, 5:42 AM
Post #1 of 4
(2345 views)
|
Input simultaniously in perl and txt
|
Can't Post
|
|
Hi, I seriously can't find out how to do this, first i'll give you the sample code: #!/usr/bin/perl -w #sascii - show ASCII values for keypresses use Term::ReadKey ReadMode ('cbreak'); print "Press keys to see their ASCII values. Use Ctrl-C to quit.\n" while (1){ $char = ReadKey (0); last unless defined $char; printf("Hex: %x\n", ord($char), ord($char)); } ReadMode ('normal'); =========================================== If you make this a .pl program you'll see that when the program is started you get a hex value in return for every key you press... so for example push the spacebar and hex=20. But that is only if you push the spacebar in the cmd (anyway I use it from the cmd). But I wan't to use it from a notepad / wordpad / MSword file. In short: Run Program Open notepad (automated by starting up the program) Type stuff exit notepad return to cmd and see output + hex values Really hope you can help me, its the last touch on my program Grtz, Harry
|