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

libretro: play games without a keyboard. #148

Open
audetto opened this issue Mar 9, 2024 · 13 comments
Open

libretro: play games without a keyboard. #148

audetto opened this issue Mar 9, 2024 · 13 comments
Labels

Comments

@audetto
Copy link
Owner

audetto commented Mar 9, 2024

From #139 (comment)

It might be useful to remap some keys to the gamepad so a keyboard is not needed.

I think it is a good idea.
Can you give more details. Is there another libretro core which allows it?

@audetto audetto changed the title libretro: paly games without a keyboard. libretro: play games without a keyboard. Mar 9, 2024
@sfatula
Copy link

sfatula commented Mar 10, 2024

I believe fmsx does. And Dosbox pure. There was at least one more, it was even in the retroarch core doc but can't locate it right now. I think it was fuse. Libretro seems to indicate so.

So, think loderunner as an example. Using the joystick works wonderfully. But you get stuck and you have to abort the level and lose a life. That's takes a ctrl-a, meaning, hooking up a keyboard just so you can type a ctrl-a.

There are other games (esp some SSI games) where there are keyboard commands, but they are very limited in number.

If a game was truly keyboard, then, you'd have to use a real keyboard of course if it had a lot of commands like typing names, etc. (thinking Wizardry).

I have a big problem using Applewin as is though, even on the keyboard, ctrl-a or ctrl-r does not work. Is there also any way to stop "start" from resetting the machine, very easy to accidentally do.

@audetto
Copy link
Owner Author

audetto commented Mar 16, 2024

If CTRL-A and -R do not work, it is a bug. Their scancode is 1 and 12.
Uncomment line 221 of game.cpp and copy here the output when you press these keys.

audetto added a commit that referenced this issue Mar 16, 2024
#148

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
@audetto
Copy link
Owner Author

audetto commented Mar 16, 2024

And now, start must be pressed twice in 1 second to restart.

@sfatula
Copy link

sfatula commented Mar 16, 2024

I tried with ascii keyboard core setting or not (typed on KB), key code or not via xboxdrv and gamepad to send codes (they all send except control keys), just could never get it to work and you can't beat all the levels without a few times needing control-a. I will change the logging line (it's 222 in my version) and recompile and post back.

@audetto
Copy link
Owner Author

audetto commented Mar 16, 2024

I think this is the line in fuse you refer to

https://github.com/libretro/fuse-libretro/blob/847dbbd6f787823ac9a5dfacdd68ab181063374e/src/libretro.c#L35

and

https://github.com/libretro/fuse-libretro/blob/847dbbd6f787823ac9a5dfacdd68ab181063374e/src/libretro.c#L286-L300

If I read this correctly, once they are set, they override whichever meaning the joypad button already had.

I don't know, it seems such an obvious requirement, that libretro should provide it once and for all cores. Are we sure, it is not already available?

audetto added a commit that referenced this issue Mar 16, 2024
#148

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
@sfatula
Copy link

sfatula commented Mar 17, 2024

So, here's some log entries:

RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00 RA2: processKeyDown - 00 132 00 00

An entry is made when holding down the left control key in this case, but, then any key with it is missed and has no log entry. So, no combo apparently.

Pretty sure there is no all cores feature to type a keyboard key from a controller button. In the manual, they suggest using xboxdrv. That does work but it's a lot of work.

@audetto
Copy link
Owner Author

audetto commented Mar 17, 2024

As you can see, there is no early exit in that function. It sounds an issue with the frontend.

Which one are you using?

@sfatula
Copy link

sfatula commented Mar 17, 2024

ra2 via retroarch

@audetto
Copy link
Owner Author

audetto commented Mar 19, 2024

It is controlled by a setting in retroarch.

AppleWin recommends to enable Game Focus Mode

https://github.com/audetto/AppleWin?tab=readme-ov-file#ra2

For the exact behaviour, check the libretro doc or forums.

@sfatula
Copy link

sfatula commented Mar 20, 2024

Yes, I am aware of game focus mode, on or off makes no difference, I cannot abort the level with control-a. It does work with SA2. Just not libretro

@audetto
Copy link
Owner Author

audetto commented Mar 21, 2024

On my retroarch (been using git version for the last N years, at the moment I am on 1.17.0)

  1. Game Focus On: all CTRL- are passed to the core.
  2. Game Focus Off: some CTRL- are trapped (including A and R, but not C).

Unless you find another core which works, I can only suggest to reach to a libretro forum.

@sfatula
Copy link

sfatula commented Mar 21, 2024

Helpful to know it works for you, will have to look elsewhere then as it definitely does not work for me. Strange!

@audetto
Copy link
Owner Author

audetto commented Sep 1, 2024

Unless more evidence points to an AppleWin issue, I will close this.

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

No branches or pull requests

2 participants