Win32 globalhook keylogger, why are the number keys not consecutive?

  • Thread starter Thread starter NotASmurf
  • Start date Start date
Click For Summary
The discussion centers on the use of a global hook for keyboard key capture, specifically regarding the discrepancy between expected ASCII values for keys 1-9 (48-57) and the actual logged values (480-568). Participants clarify that the logged values are likely not ASCII codes but rather keyboard scan codes, which differ from ASCII values. The mention of uppercase notation for lowercase characters and unexpected values for shift keys (160 and 161) further emphasizes the distinction between scan codes and ASCII. The conversation highlights the importance of understanding these differences when capturing key inputs.
NotASmurf
Messages
150
Reaction score
2
I'm using a globalhook into the keyboard for key capture, if I look up the ascii values for the keys 1-9, I see 48-57.
Now the actual logger shows

480
491
502
513
524
535
546
557
568

Sure, maybe it's ascii, maybe its because they're not numpad keys, but regardless, why are the numbers not consecutive?

Any help appreciated.
 
Technology news on Phys.org
Are you sure you're printing them out right? Is it possible you're printing out the value concatenated with the array index or something?
 
nope, if I type a, it prints 65, so that's fine (although it's weird that it uses uppercase notation for lowercase charecters), although left and right shift are `160 and 161 respectively. When it should be 15 in ascii.
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

  • · Replies 41 ·
2
Replies
41
Views
6K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
5
Views
3K
Replies
5
Views
18K