cloud-game
cloud-game copied to clipboard
dosbox_pure_libretro.so keyboard mapping
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.
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?
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 }
maybe best to do a controller mapping scheme based on what core is loaded (if that is possible)?
-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)
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)
- 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
- 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)?
- 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)
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.
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.
e.g. different configurable defaults depending on client device string (ios, windows, android, ...)