CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Input simultaniously in perl and txt

 



HarryAchterdeur
Novice

Oct 3, 2012, 5:42 AM

Post #1 of 4 (1154 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


FishMonger
Veteran / Moderator

Oct 3, 2012, 6:57 AM

Post #2 of 4 (1152 views)
Re: [HarryAchterdeur] Input simultaniously in perl and txt [In reply to] Can't Post

Sounds like you're trying to figure out how to write a keylogger malware program.


HarryAchterdeur
Novice

Oct 3, 2012, 7:00 AM

Post #3 of 4 (1150 views)
Re: [FishMonger] Input simultaniously in perl and txt [In reply to] Can't Post

Yeah I know it sounds like it but im writing a program that analyses typing behaviour.. And I don't want it by any means to be hidden or something... Im trying to build an interface for my users so that they can type normally instead of vertically if you'd seen the output from this program.


FishMonger
Veteran / Moderator

Oct 3, 2012, 4:49 PM

Post #4 of 4 (1138 views)
Re: [HarryAchterdeur] Input simultaniously in perl and txt [In reply to] Can't Post

It's probably possible to do this in Perl, but not on its own. You'll need to embed C code that accesses low level system functions.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives