diff --git a/ReadMe.txt b/ReadMe.txt index b6fe2ef..f4dfad4 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -54,6 +54,11 @@ NOT WORKING YET 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) - Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62. diff --git a/app/build.gradle b/app/build.gradle index 51caa70..b4b215b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,8 +33,8 @@ android { applicationId "org.emulator.forty.eight" minSdkVersion 19 targetSdkVersion 28 - versionCode 11 - versionName "1.7" + versionCode 12 + versionName "1.8beta1" setProperty("archivesBaseName", "Emu48-v$versionName") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { diff --git a/app/src/main/assets/ReadMe.txt b/app/src/main/assets/ReadMe.txt index a129fc9..f3168fd 100644 --- a/app/src/main/assets/ReadMe.txt +++ b/app/src/main/assets/ReadMe.txt @@ -54,6 +54,11 @@ NOT WORKING YET 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) - Updated source code from Eric Rechlin's Emu48 version 1.61+ that was merged from Christoph Gießelink's Emu48 version 1.62. diff --git a/app/src/main/java/org/emulator/calculator/MainScreenView.java b/app/src/main/java/org/emulator/calculator/MainScreenView.java index 24aa661..13255de 100644 --- a/app/src/main/java/org/emulator/calculator/MainScreenView.java +++ b/app/src/main/java/org/emulator/calculator/MainScreenView.java @@ -25,6 +25,7 @@ import android.graphics.Paint; import android.util.DisplayMetrics; import android.util.Log; import android.util.SparseIntArray; +import android.view.InputDevice; import android.view.KeyEvent; import android.view.MotionEvent; @@ -202,7 +203,9 @@ public class MainScreenView extends PanAndScaleView { @Override 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(); Integer windowsKeycode = charmap.get(pressedKey); if(windowsKeycode == null) @@ -220,7 +223,9 @@ public class MainScreenView extends PanAndScaleView { @Override 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(); Integer windowsKeycode = charmap.get(pressedKey); if(windowsKeycode == null)