Windows Forms keylogger special characters

MrPeter

New member
Joined
Dec 23, 2023
Messages
3
Programming Experience
Beginner
Hello, I want to program a keylogger that will check my typing efficiency and error rate. I would like to store texts in a database. The problem is that when I use code from this page below it doesn't output me any special characters like [] {} $%^&*, some of these are displayed with shift + some key. This is link where i tried both solutions . Do you have any adviced how to display special characters? Or i should code somethink when user press shift + some key display $ for example.
 
If your read article closely, both methods just give you the virtual key code, not the translated character values. You will need to find a way to map the sequence of keypresses and the keyboard state (e.g. was the shift or other modifier keys down) into the character(s).
 
If your read article closely, both methods just give you the virtual key code, not the translated character values. You will need to find a way to map the sequence of keypresses and the keyboard state (e.g. was the shift or other modifier keys down) into the character(s).

Do you know method how to translate this virtual keys into characters which windows display based on specific combination? I wanna check differences and analyse writing on en language keyboard and others like espanyol, ukraine, etc,...
 
I think i am converting now virtual keys to real one. But do you have idea about combinations? Now when i press shift and 4 its just shift and 4 not characted of dolar $.
 
See post #3.

Also show us your code.
 
Stepping back a bit, since you are using the low level Windows keyboard hook, that means that you are only watching the events sent to your own program. Since you are writing code in WinForms, what's wrong with using the built-in WinForms keyboard handling?

It's too bad that when Microsoft "resurrected" Jessica Fosler's wonderful blog post "Probably more than you want to know about keyboarding in Windows Forms…." that they lost the formatting. But at least the content is there to read. It's invaluable in understanding how keyboard input works in WinForms.

 

Latest posts

Back
Top Bottom