0x10cAtlas / AtlasOS

An operating system for DCPU-16.
109 stars 15 forks source link

new keyboard driver based on notch's code #29

Closed rustyoz closed 12 years ago

rustyoz commented 12 years ago

from a decompiled version of the Java applet at dcpu.com/highnerd/ the code at https://gist.github.com/2410807 , i think shows that the keyboard counts along the ring buffer and supports three events KeyTyped KeyPressed and KeyReleased.

The current driver doesn't follow a buffer position/offset value, but i think it will register each event as simply another character. I think a new keyboard driver is needed.

Comments?

chessmaster42 commented 12 years ago

Do any of the emulators have this implemented yet so that we can test?

chessmaster42 commented 12 years ago

Also, I looked through the decompile again and from what I can tell the key pressed / released are only triggered if the particular key is defined in the keymap of the emulator. And even on key pressed the value that is stored is the same as key typed. The difference is that if it key is in the map and triggers the key released then the key value gets OR'd with 0x100.

I think that a small update to AND the key value with 0x0FF will keep it clean until we handle the new event. Might also just wipe it to 0 to prevent double entries when pressed then released

rustyoz commented 12 years ago

ok i guess it will get sorted out once a good emulator environment from notch comes out.

mateusz commented 12 years ago

Got a pull request here with an interim fix: https://github.com/0x10cAtlas/AtlasOS/pull/34 . This gets DevKit running - it actually seems to be supporting some KeyUp events - eg. try pressing s, and you will get a as an output: sS (where S has a different colour :)