-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement keyboard controls #1
Comments
|
I've tried something. The menu works, but the game crashes due to not enough memory. Even e1m8 crashes. Ingame is probably not gonna work well, because I didn't implement Can I copy this code of doomgeneric-ascii? |
"When a key was held previously, but not now, send a ev_keyup event. This only seems to work on fast computers. And the keyboard repeat rate and delay time is annoying: Holding a key down will only do something after a short delay." |
Hi @FrenkelS, I haven't had time to dive into the specific Doom code (yet), but want to make the suggestion, if possible that a way be made available, if not already done, that allows using just regular keyboard keys to run Doom. Something like h/l for left right and j/k for up down, etc. I can definitely help you get arrow keys working for ELKS, but its a bit complicated, and depends on Doom calling Does Doom currently read scan codes directly from the keyboard, or is it going through the ELKS read function? Given that you're already grabbing the INT 8 timer interrupt (which is problematic, but we'll talk about that later), if there is already a bunch of code to handle keyboard scan codes directly from INT 9, that could also work. I need to understand more to suggest the best way for ELKS. Of course, whenever any interrupt is grabbed, the ELKS timesharing mechanism goes out the window, but that may not matter right now.
There's a way to directly program the keyboard controller to change the delay time - I can look that up if you're interested. Basically, you send a byte or two to the 8042 chip and it sets the keyboard repeat rate (and possibly the delay, have to look at that also).
Yes, parsing the ESC [ A sequences etc should work for ELKS, but that method requires using |
I just reviewed that code, and yes, it looks very good and should be able to port over to ELKS Doom with few problems. I say give it a try for sure! Apparently they have got Doom running without scan codes or keyup events; making the ELKS version the same way and not depending on the keyboard interrupt will go a long way to being able to run Doom without denigrating the kernel, allowing other tasks to run in the background if desired. |
The arrows on my numeric keyboard on my laptop do work with numlock on Box86 emulator. |
How do you implement keyboard events in ELKS?
In the DOS version the keyboard interrupt is replaced by an implementation that stores every key press in a buffer. Then in I_StartTic() the keys in the buffer are processed.
The text was updated successfully, but these errors were encountered: