- Jun 6, 2020
- 11,593
- 4,507
I wrote an App using the 'Activity_KeyPress' Event to react on input from a Bluetooth-Keyboard. So if you press x for example it will start a function.
Everything works fine – except if you press the Enter Key (KeyCode 66) !
By pressing the enter key, a button on the screen will be pressed automatically.
You can see how the button is pressed and the function of the button is executed. The function of the EnterKey is ignored completly.
Is there something special with the Enter KeyCode?
Ok I just figured out that the 'Activity_KeyPress' Event isn't triggered if you are pressing the Enter-Key short - it's only triggered, if you are pressing it down a little bit longer (1 sec). By pressing the key longer, the Button on the screen will be pressed AND the function of the Enter Key will be executed.
If you are pressing the Enter-Key and Holding it down the Keyboard will send the Enter Key several times. So it seams the first hit on the Enter-Key is catched by the button the second...
Everything works fine – except if you press the Enter Key (KeyCode 66) !
By pressing the enter key, a button on the screen will be pressed automatically.
You can see how the button is pressed and the function of the button is executed. The function of the EnterKey is ignored completly.
Is there something special with the Enter KeyCode?
Ok I just figured out that the 'Activity_KeyPress' Event isn't triggered if you are pressing the Enter-Key short - it's only triggered, if you are pressing it down a little bit longer (1 sec). By pressing the key longer, the Button on the screen will be pressed AND the function of the Enter Key will be executed.
If you are pressing the Enter-Key and Holding it down the Keyboard will send the Enter Key several times. So it seams the first hit on the Enter-Key is catched by the button the second...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید