1
0
Fork 0
forked from wry/wry

seat: add KeyboardState and dynamically switch between states

This commit is contained in:
Julian Orth 2024-04-14 13:16:18 +02:00
parent 134e3cc316
commit 5e2cdef388
15 changed files with 406 additions and 222 deletions

View file

@ -10,7 +10,7 @@ use {
rect::Rect,
renderer::Renderer,
utils::numcell::NumCell,
xkbcommon::ModifierState,
xkbcommon::KeyboardState,
},
jay_config::Direction as JayDirection,
std::{
@ -158,16 +158,24 @@ pub trait Node: 'static {
// EVENT HANDLERS
fn node_on_key(&self, seat: &WlSeatGlobal, time_usec: u64, key: u32, state: u32) {
fn node_on_key(
&self,
seat: &WlSeatGlobal,
time_usec: u64,
key: u32,
state: u32,
kb_state: &KeyboardState,
) {
let _ = seat;
let _ = time_usec;
let _ = key;
let _ = state;
let _ = kb_state;
}
fn node_on_mods(&self, seat: &WlSeatGlobal, mods: ModifierState) {
fn node_on_mods(&self, seat: &WlSeatGlobal, kb_state: &KeyboardState) {
let _ = seat;
let _ = mods;
let _ = kb_state;
}
fn node_on_button(