flat assembler
Message board for the users of flat assembler.
Index
> Windows > [Closed] How to manipulate keybord stuff. Goto page 1, 2 Next |
Author |
|
revolution 08 Nov 2020, 22:23
You will have to replace the keyboard driver in the kernel.
And depending upon your Windows version you might need to have it signed for Windows to accept it. |
|||
08 Nov 2020, 22:23 |
|
codeHacker101 08 Nov 2020, 22:26
You have been a big help in a previous question I asked, so am pleasantly surprised to see its you again.
Last edited by codeHacker101 on 08 Nov 2020, 22:33; edited 1 time in total |
|||
08 Nov 2020, 22:26 |
|
codeHacker101 08 Nov 2020, 22:30
"replace the keyboard driver" sounds like a very permanent change. I was hoping for an exe that will make this happen when I double-click on it to run it and things would go back to normal when I close the program/terminate the process. It that possible?
|
|||
08 Nov 2020, 22:30 |
|
revolution 08 Nov 2020, 22:33
Not possible from user mode.
That would break the security of Windows and allow anyone to log keystrokes. |
|||
08 Nov 2020, 22:33 |
|
codeHacker101 08 Nov 2020, 22:34
I intend to run the program as admin
|
|||
08 Nov 2020, 22:34 |
|
revolution 08 Nov 2020, 22:35
Admin is still user mode.
You need to do this from the kernel. |
|||
08 Nov 2020, 22:35 |
|
codeHacker101 08 Nov 2020, 22:36
Do I have to create my own driver or something?
|
|||
08 Nov 2020, 22:36 |
|
codeHacker101 08 Nov 2020, 22:38
Sounds pretty impossible for a uni student who started assembly a few weeks ago.
|
|||
08 Nov 2020, 22:38 |
|
revolution 08 Nov 2020, 22:38
codeHacker101 wrote: Do I have to create my own driver or something? codeHacker101 wrote: Sounds pretty impossible for a uni student who started assembly a few weeks ago. |
|||
08 Nov 2020, 22:38 |
|
revolution 08 Nov 2020, 22:39
Or use a different OS.
DOS would make this trivial. |
|||
08 Nov 2020, 22:39 |
|
codeHacker101 08 Nov 2020, 22:43
You said "kernal" and I found this https://www.educative.io/edpresso/what-is-windows-kernel. Don't even know what DOS is. Maybe I can disable a key, still detect it somehow and programatically send a different keypress. I think you can send keypress in C++. Maybe also assembly.
|
|||
08 Nov 2020, 22:43 |
|
revolution 08 Nov 2020, 22:48
You can't use a user-mode program to override any kernel driver.
You can send fake keypresses to other applications. But that isn't what you described in the first post. It would just add more keys into the queue of the application. |
|||
08 Nov 2020, 22:48 |
|
codeHacker101 08 Nov 2020, 22:57
So I may be able to
1) disable both keys 2) still somehow detect when either gets pressed 3) enable temperarily, send keystroke, disable again Sort of like pseudo replacement instead of real. What do you think? |
|||
08 Nov 2020, 22:57 |
|
codeHacker101 08 Nov 2020, 22:59
Are 1 and 2 possible in user mode?
|
|||
08 Nov 2020, 22:59 |
|
codeHacker101 08 Nov 2020, 23:03
Its after 4am here right now and I don't want to take too much of your time either because an ameture like me can turn this into an endless debate and still get nowhere.
But when you said "kernal" it helped me because I googled "windows kernal" and it increased me in knowledge. Maybe thats the best I can do right now. GOOGLE different relevant terminologies to help figure out a way forward. So if you are willing please tell me more such words and phrases so I can start learning. If not, thank you a lot for bothering to respond to my silly question anyways. |
|||
08 Nov 2020, 23:03 |
|
revolution 09 Nov 2020, 03:11
From user mode you can't disable keystrokes in the kernel driver.
You can't prevent the driver from doing its job unless you have your own kernel driver. The only thing you can do from user mode is wait for the OS to tell you which keys are pressed. If another application has the focus then that app will get the keystrokes, not you, and you can't prevent that. |
|||
09 Nov 2020, 03:11 |
|
Ali.Z 09 Nov 2020, 03:49
as rev said, you cannot switch/replace keycode unless you alter the device driver or implement yours.
so what you want to achieve isnt easily doable, and make no sense to swap to keys; 1. no you cant 2. yes 3. im not sure what do you mean as for 2, you can attach to thread input as every virtual thread have its own input queue/stack (regardless of the subsystem) but to be more subsystem specific, i.e. gui subsystem then you can make a small dll and inject it into foreground window, the windows who have current focus and hook their window procedure and specifically listen to keydown messages. _________________ Asm For Wise Humans |
|||
09 Nov 2020, 03:49 |
|
codeHacker101 09 Nov 2020, 06:37
Sorry I wasted both of your time @revolution and @Ali.Z. This is clearly not doable in a way I was thinking. I was getting far ahead of myself. I have added [Closed] to the title (had to make it shorter because of the word limit). Thank you both for your assistance.
|
|||
09 Nov 2020, 06:37 |
|
Grom PE 10 Nov 2020, 03:58
To swap keys around, you don't even need a running program, all you need is a custom keyboard layout.
For more complicated keyboard manipulation, might want to look into WH_KEYBOARD_LL. |
|||
10 Nov 2020, 03:58 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.