Skip to content
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

Keyboard issue on Haiku (my port) #324

Closed
theclue opened this issue Oct 27, 2018 · 7 comments · Fixed by #347
Closed

Keyboard issue on Haiku (my port) #324

theclue opened this issue Oct 27, 2018 · 7 comments · Fixed by #347
Labels

Comments

@theclue
Copy link
Contributor

theclue commented Oct 27, 2018

Good evening,

this is not exactly an issue but rather a request for advices/support.

I'm porting OpenDUNE on Haiku. The port works and the game is playable, although with no sound, with a minor patch you can fine here (mostly related to system paths). This is based on OpenDUNE v0.9 release.

The game builds well on both SDL and SDL2, but with the latter is extremely slow, so I rever back to SDL for now.

But I have a serious issue with keyboard: basically all the keys are totally messed up (for example, hitting 'n' send the code for '9'). I noticed it while naming a savegame.

The issue goes away with SDL2 (but as I said, the game is unplayable with SDL2).

Do you have an idea on what could cause the issue?

@miniupnp
Copy link
Contributor

the PC keyboard scan codes are guessed from the SDL scancodes. I guess they are wrong when running on Haiku (but right on linux)
https://github.com/OpenDUNE/OpenDUNE/blob/master/src/video/video_sdl.c#L651

@miniupnp
Copy link
Contributor

@theclue have you been able to look at which scancodes values are given in event.key.keysym.scancode ?
You can check the values for a few keys ESC, the spacebar, etc.
and compare with the PC/AT scancodes https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

@theclue
Copy link
Contributor Author

theclue commented Nov 13, 2018

Not yet (I'm not a developer so I hardly find my way into source code). However I've got a feedback from one of the main core devs at Haiku about scancodes. Fyi: haikuports/haikuports#3275 (comment)

@miniupnp
Copy link
Contributor

OK so a mapping from SDL or Haiku (Be) keycodes back to PC scan code has to be done...

@pulkomandy
Copy link

The keycodes used in Haiku are as defined here: https://www.haiku-os.org/docs/api/keyboard.html
It seems the OpenDUNE code already includes a translation table for Mac OS, I think a similar approach can be used for Haiku.

@theclue
Copy link
Contributor Author

theclue commented Jun 11, 2020

After a couple of years, I'm going to resurrect the porting to Haiku. So I was wondering if the project is still active and if there're some chances to have support on this.

Additionally, Haiku port additions could be eventually added upstream here, perhaps?

@miniupnp
Copy link
Contributor

After a couple of years, I'm going to resurrect the porting to Haiku. So I was wondering if the project is still active and if there're some chances to have support on this.

Additionally, Haiku port additions could be eventually added upstream here, perhaps?

well I wil happily consider any pull request to add Haiku support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants