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

dosbox_pure_libretro.so keyboard mapping #363

Open
Kenneth-Audenaert opened this issue Jan 26, 2022 · 11 comments · May be fixed by #436
Open

dosbox_pure_libretro.so keyboard mapping #363

Kenneth-Audenaert opened this issue Jan 26, 2022 · 11 comments · May be fixed by #436
Labels
input Input stuff (keyboard, controllers and such)

Comments

@Kenneth-Audenaert
Copy link

Kenneth-Audenaert commented Jan 26, 2022

my end goal is to get dosbox games running in the same way that the other cores work.

I successfully installed dosbox_pure_libretro.so as a new core and added a game to the games folder
adjusted config.yaml, started up the server and worker and got a game running.

however it seems the keyboard does not map to what the dosbox core expects.

imho I would expect that web/js/input/input.js and web/js/input/keyboard.js have a role to play in the client side of the controller support.

no clue about the server side though.

@Kenneth-Audenaert
Copy link
Author

Kenneth-Audenaert commented Jan 27, 2022

not sure if this should be seperate issues or not but here goes (it's in the same vain as the main toppic)

dosbox_pure_libretro does some fancy automapping which works quite ok if you use a controller.

I tried with both an xbox style controller (logitech rumblepad 2) on a pc and an xbox controller on an xbox one x, this does seem to map quite ok in most cases (dos platformers work mostly ok)

however there does not seem to be a way to switch to fullscreen mode in cloudretro with an xbox style controller (other then plugging in a keyboard to press the "F" key).

I also noticed that the right stick is not mapped to anything nor are the push functions of both sticks. (usually L3 en R3)

maybe these could be mapped to the function for the F key on controllers?

I know that dosbox_pure_libretro is able to display an onscreen keyboard when playing games. cfr: https://github.com/schellingb/dosbox-pure#on-screen-keyboard
This is handy when playing dosgames which require some weird unmapped key press (dos games tend to have these).

but there is no way to call this onscreen keyboard with the current cloudretro controller mapping scheme. (if i'm not mistaken this is mapped to L3 by default in dosbox_pure_libretro)

This onscreen keyboard is a nice way of allowing for additional keypresses without actually implementing all the seperate keypresess natively through the entire cloud-retro stack.

could the L3 functionality be enabled?

@Kenneth-Audenaert
Copy link
Author

Kenneth-Audenaert commented Jan 27, 2022

joystick.js adjusted mainly for dosbox_pure L3 mapping (virtual keyboard) and allowing dosbox_pure to do more efficient magic mapping.

125         } else {
126             // default of other OS is KeyMap2
127             joystickMap = {
128                 0: KEY.A,
129                 1: KEY.B,
130                 // default xbox style controller mapping so dosbox_pure can do its magic mapping better
131                 2: KEY.X,
132                 3: KEY.Y,
133                 // allow L3/R3 mapping for dosbox_pure to be able to call the virtual keyboard
134                 4: KEY.L3,
135                 5: KEY.R3,
136                 // default xbox style controller mapping so dosbox_pure can do its magic mapping better
137                 8: KEY.SELECT,
138                 9: KEY.START,
139                 // enable fullscreen toggle from controller for couch-surf playing on xbox
140                 6: KEY.FULL,
141                 7: KEY.QUIT,
142                 12: KEY.UP,
143                 13: KEY.DOWN,
144                 14: KEY.LEFT,
145                 15: KEY.RIGHT
146             };
147         }

@Kenneth-Audenaert
Copy link
Author

maybe best to do a controller mapping scheme based on what core is loaded (if that is possible)?

@Kenneth-Audenaert
Copy link
Author

-testing on windows client with rumble pad 2 works great.
-testing on xbox all works fine in "game controller mode", except that pressing "B" in fullscreen mode quits fullscreen mode
(mostly mapped to the jump key in dosbox_pure games, so only really playable in windowed mode for now)

@sergystepanov
Copy link
Collaborator

sergystepanov commented Jan 27, 2022

There is no option for the client (browser) to know what core is running at the moment.
So, does the B button exit from the browser fullscreen mode? (just what F11 does on the keyboard)

@Kenneth-Audenaert
Copy link
Author

Kenneth-Audenaert commented Jan 27, 2022

  • mapping based per selected game, maybe that's an option? (most of the time there won't be overlap, dos games require dos layout, nes games nes layout, ...)
  • yes it just exits full screen, the game keeps running just fine

@sergystepanov
Copy link
Collaborator

sergystepanov commented Jan 27, 2022

  • mapping based per selected game, maybe that's an option? (most of the time there won't be overlap, dos games require dos layout, nes games nes layout, ...)

Doesn't matter, it's not implemented on the client. We need to expose some IDs for cores and games and a UI to be able to tweak it which is the hardest part. Current cloud-retro options UI is far from perfect and, I think, won't work with controllers also (you can try (;).

  • yes it just exits full screen, the game keeps running just fine

Strange. Do both buttons (B and FullScreen) toggle it (or does B only exits)?

@Kenneth-Audenaert
Copy link
Author

Kenneth-Audenaert commented Jan 27, 2022

  • butten mapped to KEY.FULL (6) togles fullscreen on or of
  • button mapped to KEY.B (1) only exits (does not toggle) when in fullscreen mode (with "game controller mode" enabled) and also registers as the actual B button (in either fullscreen or windowed mode)

@Kenneth-Audenaert
Copy link
Author

is there a way to just run the app in fullscreen by default, and disabling fullscreen/windowed togling?

appart from the cool handheld aesthetic, I don't see a good reason (at least for my intended purposes) to have it in a window anyway.

@sergystepanov
Copy link
Collaborator

Not possible, but it'll be not that hard to add.
Yeah, this handheld-like UI makes sense only with smartphones (touch screens). Not sure about making it fullscreen by default, but as an option, why not.

@Kenneth-Audenaert
Copy link
Author

e.g. different configurable defaults depending on client device string (ios, windows, android, ...)

@sergystepanov sergystepanov added the input Input stuff (keyboard, controllers and such) label Oct 14, 2023
@sergystepanov sergystepanov linked a pull request Nov 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input Input stuff (keyboard, controllers and such)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants