简体   繁体   中英

How to write key input in assembly?

I'm trying to make a keyboard driver for windows & linux as a project, I was looking to simulate the actual process of writing a key (meaning not using anything such as windows messages), and after move on to the waiting for input from keyboard which I found alot of tutorials for. Anyone know hot to do this for Windows & Linux? (running intel proc win10 64bit & kali linux amd proc 64bit)

You cannot have the same driver on Windows and on Linux. You'll need to make two different, unrelated, programs and you have to design them differently (because Windows and Linux have different architectures for drivers).

BTW, on Linux, with a graphical desktop, a display server (such as Xorg or Wayland ) is running. That server is the only program handling the physical keyboard. You might consider working with it.

The actual notion of keyboard driver is too broad to make a concrete sense. On Linux, you could patch the kernel, patch the display server, improve the window manager , etc... There is no need, and not much interest, in coding that stuff in assembler.

Notice that on Linux, with a graphical desktop, the keyboard layout is handled in the display server, not in kernel code (so the kernel is sending key events with keycodes close to scancodes , not characters; the Xorg server sends keyboard events with similar keycodes to eg the window manager). Read more about the X Window System protocols and architecture and eg EWMH . The graphical layers are very complex (both on Linux and on Windows), many millions of lines of code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM