diff --git a/app/build.gradle b/app/build.gradle index 49f34bb..65d7065 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "es.eoinrul.ecwt" minSdkVersion 23 targetSdkVersion 29 - versionCode 41 - versionName "4.1" + versionCode 42 + versionName "4.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/es/eoinrul/ecwt/SounderActivity.kt b/app/src/main/java/es/eoinrul/ecwt/SounderActivity.kt index 4d8a358..fd37812 100644 --- a/app/src/main/java/es/eoinrul/ecwt/SounderActivity.kt +++ b/app/src/main/java/es/eoinrul/ecwt/SounderActivity.kt @@ -33,6 +33,15 @@ class SounderActivity : AppCompatActivity() { onTextEntered("E"); // Display and sound something - this is arbitrary } + // This will be called for connected USB/Bluetooth keyboards: + override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { + val sequence = KeycodeToSoundSequence(keyCode) + mTextViewTest?.text = SequenceToString(sequence) + mSoundPlayer?.enqueue(sequence) + mKeyboardInput?.setText("") // Should be empty due to physical keyboard + return true; + } + override fun onResume() { super.onResume() initSoundPlayer() @@ -69,7 +78,8 @@ class SounderActivity : AppCompatActivity() { private var mSoundPlayer : DitDahSoundStream? = null; - // Utility to watch our EditText and handle any user input: + // Utility to watch our EditText and handle any user input + // This only seems to get triggered if we're using the software keyboard private val mInputHandler = object : TextWatcher { override fun afterTextChanged(s: Editable?) { if(s == null) { diff --git a/fastlane/metadata/android/en-US/changelogs/42.txt b/fastlane/metadata/android/en-US/changelogs/42.txt new file mode 100644 index 0000000..3ef08b0 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/42.txt @@ -0,0 +1 @@ +Fixed a bug where Bluetooth/USB keyboards wouldn't work in sounder mode.