skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.11k stars 346 forks source link

Danb91/support keyboard analog stick #1909

Closed DanB91 closed 4 years ago

DanB91 commented 4 years ago

Support for using the keyboard keys the analog stick on the Dreamcast controller. This PR adds support for any platform Reicast is on, but only adds default values for Mac/Windows/Linux.

To keep things consistent with the other default keyboard controls, the default Up, Down, Left, Right are mapped to P, ;, L and ', respectively. Of course, this can be remapped to any key the user desires.

einsteinx2 commented 4 years ago

Tested on macOS. The analog sticks weren't automatically mapped though (maybe expected behavior because I already have a Reicast config file and have changed mappings in the past?), but once I mapped them it worked great. Was able to control Crazy Taxi surprisingly well considering the keys aren't analog :)

romadu commented 4 years ago

How are the analog sticks mapped using keyboard keys? When I try it doesn’t work for me. I’m using a keyboard-based android box

DanB91 commented 4 years ago

How are the analog sticks mapped using keyboard keys? When I try it doesn’t work for me. I’m using a keyboard-based android box

Are you attempting to map the analog sticks to keyboard in settings? If not, the default keys are only for Mac/Windows/Linux so you will have to map the keys yourself. If so, are you getting an error, or are the keys you mapped to simply not doing anything?

romadu commented 4 years ago

I’m using reicast-android-debug-971d614.apk which was released as a nightly build to include this update. When I try to map the keyboard buttons to analog controls, the app doesn’t accept the mapping. I’ll try again and provide details of the error

On Wed, 26 Aug 2020 at 1:26 PM, DanB91 notifications@github.com wrote:

How are the analog sticks mapped using keyboard keys? When I try it doesn’t work for me. I’m using a keyboard-based android box

Are you attempting to map the analog sticks to keyboard in settings? If not, the default keys are only for Mac/Windows/Linux so you will have to map the keys yourself. If so, are you getting an error, or are the keys you mapped to simply not doing anything?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-680663634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XC3SSCX6RI7AGOHNRDTSCSMJFANCNFSM4NHGUQXA .

romadu commented 4 years ago

I checked again. I’m using build 20.04-35 gfbda9608 for Android.

I can map Buttons but when trying to map Analog Axes with keys, the mapping isn’t accepted. The countdown times-out. There is no error.

Playing Daytona, I can select options and start the game (d-pad mappings are working) and when the game starts I can change views (up/down on d-pad) and accelerate, but cant steer left or right because there isn’t an analog mapping.

Note that Crazy Taxi works fine because it accepts d-pad key mapping for steering. Daytona requires analog axes for steering.

Any thoughts?

On Wed, 26 Aug 2020 at 9:33 PM, Robin Duxfield rduxfield@gmail.com wrote:

I’m using reicast-android-debug-971d614.apk which was released as a nightly build to include this update. When I try to map the keyboard buttons to analog controls, the app doesn’t accept the mapping. I’ll try again and provide details of the error

On Wed, 26 Aug 2020 at 1:26 PM, DanB91 notifications@github.com wrote:

How are the analog sticks mapped using keyboard keys? When I try it doesn’t work for me. I’m using a keyboard-based android box

Are you attempting to map the analog sticks to keyboard in settings? If not, the default keys are only for Mac/Windows/Linux so you will have to map the keys yourself. If so, are you getting an error, or are the keys you mapped to simply not doing anything?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-680663634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XC3SSCX6RI7AGOHNRDTSCSMJFANCNFSM4NHGUQXA .

romadu commented 4 years ago

Metropolis Street Racer, Daytona 2001, Star Wars Podracer and Test Drive 6 are examples of games that require analog controls for steering, whereas Ferrari F355, Crazy Taxi 1&2 and Sega GT work with d-pad.

On Fri, 28 Aug 2020 at 11:23 AM, Robin Duxfield rduxfield@gmail.com wrote:

I checked again. I’m using build 20.04-35 gfbda9608 for Android.

I can map Buttons but when trying to map Analog Axes with keys, the mapping isn’t accepted. The countdown times-out. There is no error.

Playing Daytona, I can select options and start the game (d-pad mappings are working) and when the game starts I can change views (up/down on d-pad) and accelerate, but cant steer left or right because there isn’t an analog mapping.

Note that Crazy Taxi works fine because it accepts d-pad key mapping for steering. Daytona requires analog axes for steering.

Any thoughts?

On Wed, 26 Aug 2020 at 9:33 PM, Robin Duxfield rduxfield@gmail.com wrote:

I’m using reicast-android-debug-971d614.apk which was released as a nightly build to include this update. When I try to map the keyboard buttons to analog controls, the app doesn’t accept the mapping. I’ll try again and provide details of the error

On Wed, 26 Aug 2020 at 1:26 PM, DanB91 notifications@github.com wrote:

How are the analog sticks mapped using keyboard keys? When I try it doesn’t work for me. I’m using a keyboard-based android box

Are you attempting to map the analog sticks to keyboard in settings? If not, the default keys are only for Mac/Windows/Linux so you will have to map the keys yourself. If so, are you getting an error, or are the keys you mapped to simply not doing anything?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-680663634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XC3SSCX6RI7AGOHNRDTSCSMJFANCNFSM4NHGUQXA .

DanB91 commented 4 years ago

Are you mapping using the Stick Up, Stick Down, etc options or Stick X/Stick Y? You need to map to Stick Up, Stick Down, Stick Left, Stick Right and not Stick X/Stick Y. Admittedly, this is confusing and unfortunately was the easiest way to implement this feature with the way Reicast is coded currently

romadu commented 4 years ago

Hi, in the controls settings screen there is left side and right side. Left side I can map up/down etc. Right side for analog controls X+, Y+ etc when I try to map by using any keyboard button it doesn’t map. The mapping isn’t accepted. It times out and nothing is assigned on the right hand side of the controls setting screen. Many Dreamcast games work with d-pad for steering (Crazy Taxi, Sega GT, Tokyo Street Racer) so the left side mapping works for those games. Some games require analog (MSR, Daytona, Star Wars podracer, Test Drive 6) and don’t respond to d-pad for steering (game menus work with d-pad) and these games can’t be controlled with the keyboard. I was hoping this fix would work for the games that need analog controls for steering.

On Sat, 29 Aug 2020 at 4:18 AM, DanB91 notifications@github.com wrote:

Are you mapping using the Stick Up, Stick Down, etc options or Stick X/Stick Y? You need to map to Stick Up, Stick Down, Stick Left, Stick Right and not Stick X/Stick Y. Admittedly, this is confusing and unfortunately was the easiest way to implement this feature with the way Reicast is coded currently

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-683129273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XC4ACCGVPJBV2VNDNHDSDAGKXANCNFSM4NHGUQXA .

romadu commented 4 years ago

To answer your question, I mapped Stick Up, Stick Left, etc (left side of map screen) and this works for menus but not for steering in those games that need analog controls for steering.

On Sat, 29 Aug 2020 at 4:18 AM, DanB91 notifications@github.com wrote:

Are you mapping using the Stick Up, Stick Down, etc options or Stick X/Stick Y? You need to map to Stick Up, Stick Down, Stick Left, Stick Right and not Stick X/Stick Y. Admittedly, this is confusing and unfortunately was the easiest way to implement this feature with the way Reicast is coded currently

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-683129273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XC4ACCGVPJBV2VNDNHDSDAGKXANCNFSM4NHGUQXA .

DanB91 commented 4 years ago

I just tested Test Drive 6 with Stick Up, Stick Down, mapped on my Mac and it works (I do not currently have an Android environment set up right now). To be clear Stick Up, Stick Down, etc, is actually the analog stick, not the D-Pad. So, I am wondering why it is working for you in the menus, but not in-game. I have attached a screenshot of my settings. I currently have Stick Up, Stick Down, etc mapped to WSAD and DPad Up, DPad Down, etc mapped to the arrow keys.

Can you send me a similar screenshot of your settings?

image

romadu commented 4 years ago

The android version doesn’t include Stick Up, Down etc. That’s the source of the confusion, we see different options. Perhaps there is a later build of Android version that includes the Stick Up/Down options? The version I’m using was built at the time to include this fix, according to the notes.

Many thanks for your help.

On Sun, 30 Aug 2020 at 12:11 AM, DanB91 notifications@github.com wrote:

I just tested Test Drive 6 with Stick Up, Stick Down, mapped on my Mac and it works (I do not currently have an Android environment set up right now). To be clear Stick Up, Stick Down, etc, is actually the analog stick, not the D-Pad. So, I am wondering why it is working for you in the menus, but not in-game. I have attached a screenshot of my settings. I currently have Stick Up, Stick Down, etc mapped to WSAD and DPad Up, DPad Down, etc mapped to the arrow keys.

Can you send me a similar screenshot of your settings?

[image: image] https://user-images.githubusercontent.com/1284373/91641174-ad788100-e9f0-11ea-9537-6de6c389a74d.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/pull/1909#issuecomment-683310165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD27XCZI7PPGVMG2VA556ADSDESCHANCNFSM4NHGUQXA .