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

  • Thread starter Thread starter NotASmurf
  • Start date Start date
AI Thread 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top