Hello I’m working on a custom LoveLace cards, which sends characters to a service.
My button clicks are working when I do this:
<button class="btn-flat flat-low ripple" @click=${() => this._remote_key_press("b")}><ha-icon icon="mdi:skip-backward"/></button>
But I thought, I can just as easy use an integrated keyboard.
so I tried this
<input type="text" id="keypadinput" placeholder="Search..." @keydown="${() => this._sendKey(event)}>">
and then this javascript
_sendKey(e) {
var key = String.fromCharCode(e.which).toLowerCase();
document.getElementById("keypadinput").value = "";
this._remote_key_press(key);
}
but for some reaseon the event isn’t even fired.
And I can’t find out how to fire the event. I tried a lot of different methods.
and when finally I can fire on keydown, I also need to find the current event. which also will become an issue.
Is there some list I can reference to to see the possibilities?