ionic-team / ionic-plugin-keyboard

Ionic Keyboard Plugin for Cordova
Apache License 2.0
611 stars 278 forks source link

how to listen to Key events #308

Open grimace opened 6 years ago

grimace commented 6 years ago

I've tried adding an eventListener to document ( which has worked in a other keyboard plugins ), like this:

document.addEventListener('keydown', (key) => {this.onKeyPress(key)} );

but when I get the event call back, all I get is:

{"isTrusted":true}"

Is there a way to listen for keydown or keyup?