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

  • Thread starter Thread starter NotASmurf
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the behavior of a global keyboard hook used for key capture in a keylogger application, specifically addressing the non-consecutive values observed for number keys when compared to their expected ASCII values.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant notes that the keylogger shows values for the number keys that are not consecutive, questioning the reason behind this discrepancy.
  • Another participant suggests verifying the output method to rule out issues such as concatenation with the array index affecting the printed values.
  • A participant confirms that their output for other characters, like 'a', is correct, but expresses confusion over the representation of shift keys with values that do not align with ASCII expectations.
  • One participant clarifies that keyboard scan codes differ from ASCII codes, implying that the observed values may be related to scan codes rather than ASCII values.

Areas of Agreement / Disagreement

Participants do not reach a consensus; there are competing views regarding the nature of the values being captured and the potential reasons for the discrepancies.

Contextual Notes

There is a lack of clarity on the definitions and distinctions between keyboard scan codes and ASCII codes, which may contribute to the confusion in the discussion.

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.
 

Similar threads

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