mirror of
https://github.com/dgis/emu48android
synced 2024-12-26 09:58:49 +01:00
Try to better detect a physical keyboard to modify the mapping of the keys (Eric issue with S7).
This commit is contained in:
parent
27cecc7fe3
commit
7420e20f92
4 changed files with 19 additions and 4 deletions
|
@ -54,6 +54,11 @@ NOT WORKING YET
|
||||||
|
|
||||||
CHANGES
|
CHANGES
|
||||||
|
|
||||||
|
Version 1.8beta1 (2019-12-18)
|
||||||
|
|
||||||
|
- Try to better detect a physical keyboard to modify the mapping of the keys.
|
||||||
|
|
||||||
|
|
||||||
Version 1.7 (2019-12-12)
|
Version 1.7 (2019-12-12)
|
||||||
|
|
||||||
- Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62.
|
- Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62.
|
||||||
|
|
|
@ -33,8 +33,8 @@ android {
|
||||||
applicationId "org.emulator.forty.eight"
|
applicationId "org.emulator.forty.eight"
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 11
|
versionCode 12
|
||||||
versionName "1.7"
|
versionName "1.8beta1"
|
||||||
setProperty("archivesBaseName", "Emu48-v$versionName")
|
setProperty("archivesBaseName", "Emu48-v$versionName")
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
|
|
|
@ -54,6 +54,11 @@ NOT WORKING YET
|
||||||
|
|
||||||
CHANGES
|
CHANGES
|
||||||
|
|
||||||
|
Version 1.8beta1 (2019-12-18)
|
||||||
|
|
||||||
|
- Try to better detect a physical keyboard to modify the mapping of the keys.
|
||||||
|
|
||||||
|
|
||||||
Version 1.7 (2019-12-12)
|
Version 1.7 (2019-12-12)
|
||||||
|
|
||||||
- Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62.
|
- Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62.
|
||||||
|
|
|
@ -25,6 +25,7 @@ import android.graphics.Paint;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseIntArray;
|
import android.util.SparseIntArray;
|
||||||
|
import android.view.InputDevice;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
@ -202,7 +203,9 @@ public class MainScreenView extends PanAndScaleView {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if((event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0) {
|
if(event.getDeviceId() != -1
|
||||||
|
&& (event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0
|
||||||
|
&& (event.getSource() & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
|
||||||
char pressedKey = (char) event.getUnicodeChar();
|
char pressedKey = (char) event.getUnicodeChar();
|
||||||
Integer windowsKeycode = charmap.get(pressedKey);
|
Integer windowsKeycode = charmap.get(pressedKey);
|
||||||
if(windowsKeycode == null)
|
if(windowsKeycode == null)
|
||||||
|
@ -220,7 +223,9 @@ public class MainScreenView extends PanAndScaleView {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
if((event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0) {
|
if(event.getDeviceId() != -1
|
||||||
|
&& (event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0
|
||||||
|
&& (event.getSource() & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
|
||||||
char pressedKey = (char) event.getUnicodeChar();
|
char pressedKey = (char) event.getUnicodeChar();
|
||||||
Integer windowsKeycode = charmap.get(pressedKey);
|
Integer windowsKeycode = charmap.get(pressedKey);
|
||||||
if(windowsKeycode == null)
|
if(windowsKeycode == null)
|
||||||
|
|
Loading…
Reference in a new issue