MC9300 [physical keyboard] - Listen button calls

Tags: 

Hello,

I have an app based on ionic 4 and angular 8 where I need to integrate the hard keyboard buttons to app buttons.

Can get button calls for alphabets and numerics but not for P1 and P2 and Dpad buttons.

For eg:-
const keypressoutput = document.getElementById('pressed_keys');
alert("btn pressed Event: " + JSON.stringify(e.key));
if (e.key == "P1") {
// close app.
}

Can someone help me?

Darryn Campbell
I'm afraid I do not have a

I'm afraid I do not have a device so this will be somewhat speculative but here are a few ideas:

Note that the second two bullets are device-wide

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Gaurav Sonkusare
1. I tried with keydown event

1. I tried with keydown event for p1 and p2 buttons but they give event.key as unidentified.
Ex:
@HostListener('window:keydown', ['$event']) keyEvent(event: KeyboardEvent) {
alert(event.key);
}
2. If I remap P1 to F11 and P2 to F12 then with the same code I get back the event keys.
3. Keymapping manager is one of the solutions but if I remap P2 key as none then how to get its key event?
In this case should P2 key be always mapped to some key ?
4. Yet to try PTT key using intents.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments