libretro / 81-libretro

A port of the EightyOne ZX81 Emulator to libretro
GNU General Public License v3.0
20 stars 30 forks source link

Input Rework #12

Closed hiddenasbestos closed 6 years ago

hiddenasbestos commented 6 years ago

This commit reworks the input code so that either only virtual joystick-mapped-to-keyboard input is used, or only the actual system keyboard is used. Preventing conflict caused by mapping of keyboard keys to controller inputs.

Primarily changes "User 1 Device Type" to either Virtual Keyboard (default in RA), Keyboard or None.

leiradel commented 6 years ago

I'm sorry, could you elaborate what the problem is? Also, can you resubmit the PR without code format changes? It's hard to follow the changes.

leiradel commented 6 years ago

I mean, it seems all spaces at the end of lines were stripped, so the files have changes everywhere instead of only where you actually changed the code.

hiddenasbestos commented 6 years ago

Hi, this patch is to simplify the input system from the end user's perspective and resolve the conflict that arises when the keyboard is mapped to joypad controls.

Rather than using two ports it condenses it down to one. It also resolves the issue where the keyboard is mapped to controller inputs which resulted in conflicts when trying to use the keyboard as a real keyboard. This change lets you easily select what input mechanism you'd like to use. It also adds a nice feature where the on-screen keyboard can be operated using the keyboard.

leiradel commented 6 years ago

I don't understand. What this changes that could not be achieved before?

hiddenasbestos commented 6 years ago

I'm trying to reverse the commit and restage just the changed lines, but git isn't letting me.

hiddenasbestos commented 6 years ago

I don't understand. What this changes that could not be achieved before?

This cleans up the way to select between joystick and keyboard input and removed the bad state of both being enabled.

Keyboard navigation of the on-screen display is new.

hiddenasbestos commented 6 years ago

I'll make a new PR with just my changes in it, sorry for the inconvenience,

leiradel commented 6 years ago

This cleans up the way to select between joystick and keyboard input and removed the bad state of both being enabled.

But we need to be able to enable the keyboard and the joystick. There are joysticks other than Cursor that will be added in the future, such as Kempston.

Or am I missing something?

leiradel commented 6 years ago

As an example, look at the Fuse core. It has many different joystick types, each one can be enabled independently from the others, and from the keyboard.

hiddenasbestos commented 6 years ago

You're right, gonna abandon this.