Perhaps I overlooked this: https://openmsx.org/manual/commands.html#joystickN_config
LOL, I must have overlooked it as well. This is great. Thank you once more, @Manuel.
Anyway, this doesn't completely invalidate all the previously done research, since at least we now know how to make the hat work as both the joystick and the cursor keys.
Can you confirm it works as you want?
Yes, it works perfectly. It works even better than binding the hat to the cursor keys. That previous configuration mainly works but comparing both I can see they don't work the same.
Did this work even better? How did you use it in practice?
I tried this:
dict lappend joystick1_config LEFT L_hat0
dict lappend joystick1_config RIGHT R_hat0
dict lappend joystick1_config UP U_hat0
dict lappend joystick1_config DOWN D_hat0
Works perfect! So cool!
Did this work even better? How did you use it in practice?
I made a small program:
10 CLS 20 LOCATE 0,0:PRINT STICK(0),STICK(1) 30 GOTO 20
Then I ran the program and tried to move the d-cross in many different directions. It immediately jumped to my attention that STICK(0), which shows the state of the directional keys, and STICK(1), which shows the state of the first joystick, didn't show the same values as expected. Instead, STICK(0) seemed to lag a bit and depending of what I did, was just outright wrong. I think not all interactions were correctly predicted.
For example, for hat0 down, I think we should release left, up and right keys, not just up. At this point I was honestly a bit tired of trying more configurations, especially considering the hat0 binding to the joystick already worked better.
Anecdotally, I noticed I played Zanac EX much better with the latter configuration, despite still sucking at it.
I bound all the keys as I want them and it’s working good.
The dict binds are spot on and as the MSX rely on M, N and space, I had plenty of buttons for the F-keys.
At least for Metal Gear 1 & 2 this works good.
I'm happy to know everything worked out fine!
I tried this:
dict lappend joystick1_config LEFT L_hat0
dict lappend joystick1_config RIGHT R_hat0
dict lappend joystick1_config UP U_hat0
dict lappend joystick1_config DOWN D_hat0
Works perfect! So cool!
This is now done by default as from the current development version. Yay.