hudkit icon indicating copy to clipboard operation
hudkit copied to clipboard

Feature request: Recognise keyboard button presses globally, and pass them to addEventListener in page JS

Open grkblood13 opened this issue 5 years ago • 1 comments

hudkit doesn't seem to recognize when buttons are pressed on the keyboard. Here's a simple test page that should be displaying the keycodes.

<html>
<head></head>
<style>
body {
	background-color: #000;
	font-size: 30px;
	font-weight: bold;
	color: #fff;
}
</style>
<body>
<p id='keyCode'></p>
<script>
document.addEventListener('keydown', function(e) {
	document.getElementById("keyCode").innerHTML = e.keyCode;
});
</script>
</body>
</html>

grkblood13 avatar Mar 04 '19 01:03 grkblood13

I'd love this too, but I haven't been able to figure out how to make it work.

As it stands, if I make the window able to be focused (by commenting this line and these lines), input events are sent to the webview, but it eats them, and they don't propagate to the desktop, so the window isn't click-through anymore.

I figure it must be possible somehow to hack around with GTK's event propagation functions to do this. Duplicate the event, propagate one to the webview, and the other to the desktop? Maybe. :thinking:


Workaround: xkbcat into a WebSocket.

anko avatar Mar 04 '19 09:03 anko