Replies: 2 comments
-
Right now, webui auto detects the mouse clicks. But you can easily extend it using JavaScript. document.addEventListener('keydown', function(event) {
// Get Pressed Key
const keyPressed = event.key;
// Send the key to the backend function
webui_fn('MyFunction', keyPressed).then((response) => {
// Print the response if any
console.log("MyFunction Returned: ", response);
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank-you for this information.
Simon White
dCipher Computing
705-500-0191
On Friday, August 11, 2023 3:13:14 PM (-04:00), Albert Shown wrote:
Right now, webui auto detects the mouse clicks. But you can easily extend it using JavaScript.
document.addEventListener('keydown', function(event) {
// Get Pressed Key
const keyPressed = event.key;
// Send the key to the backend function
webui_fn('MyFunction', keyPressed).then((response) => {
// Print the response if any
console.log("MyFunction Returned: ", response);
});
});
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
Binding to a mouse click is useful but it would be helpful if we could also bind to key presses such as Enter, Tab or Escape or other keys. So let's assume that someone was using this in a keyboard only scenario. It would be helpful to be able to bind certain keys per widget or per window. The binding would send back the widget ID and the key that was pressed. In my case we are considering using this interface in private fueling yards that only have industrial weather proof keyboards.
Thanks,
Simon
Beta Was this translation helpful? Give feedback.
All reactions