dgis / emu48android

Emu48 for Android
GNU General Public License v2.0
56 stars 17 forks source link

Unsupported calculator buttons from a keyboard #6

Closed Lathe26 closed 5 years ago

Lathe26 commented 5 years ago

Using a Bluetooth keyboard with Emu48 works with the majority of calculator buttons. For example, pressing the A key on a Bluetooth keyboard will activate the A calculator button (left-most menu key) and T will activate the COS button.

However the following calculator buttons don't have a keyboard key assigned to them:

Also, the ON button half works. It is currently mapped to the ESC keyboard key. However, the Android operating system treats this as a the "back" Android button which puts Emu48 into the background and takes the user to OS's default screen. The may be a way to disable the OS's behavior or perhaps the ON button should be remapped to a different keyboard key.

These could be remapped in a custom KML file but it likely would be good to have these calculator buttons mapped by default to commonly available keys on mobile Bluetooth keyboards (less work for the end-user). Here's a link to an example Bluetooth keyboard designed for mobile phones: https://www.amazon.com/Microsoft-U6R-00001-Wedge-Mobile-Keyboard/dp/B008OEHPKM

dgis commented 5 years ago

I just fixed the DEL key.

The ESC key was generating the event KEYCODE_ESCAPE following by the event KEYCODE_BACK! So now, I prevent to generate this second BACK event. It seems still possible to generate this BACK event by pressing 4 times in a row the ESC key!

I mapped the non keypad '+', '-', '' and '/' keys by searching the character first and then the virtual key if not found. The character is not directly accessible with an US keyboard (you must press SHIFT+8), so, you must press the SHIFT_RIGHT+8 to get the multiply '*'. With french keyboard to get the non keypad number 0-9, you must press SHIFT_RIGHT+8 to get 8. This is because the SHIFT_LEFT and CONTROL_LEFT are map to the Left and Right Shift of the HP48!