From 8b3f379c3b3216485d11787bcd63a56acd51ee58 Mon Sep 17 00:00:00 2001 From: tcmal Date: Wed, 5 Jun 2024 17:25:47 +0100 Subject: add most keybind functionality (not yet running things) --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index f61f422..f99e19b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ use atoms::InternedAtoms; use clients::ClientList; use cursors::Cursors; use error::*; +use keys::KeyboardState; use xcb::{ x::{self, ChangeWindowAttributes, PropertyNotifyEvent, Window}, Connection, Event, Extension, @@ -38,6 +39,7 @@ struct WM<'a> { cursors: Cursors, atoms: InternedAtoms, + keyboard_state: KeyboardState, } impl WM<'_> { @@ -62,6 +64,7 @@ impl WM<'_> { Ok(WM { atoms: InternedAtoms::new_with(conn)?, cursors: Cursors::new_with(conn)?, + keyboard_state: KeyboardState::new_with(conn)?, clients: Default::default(), conn, screen_num, @@ -69,7 +72,7 @@ impl WM<'_> { }) } - fn setup_root(&self) -> Result<()> { + fn setup_root(&mut self) -> Result<()> { // TODO: set wm properties self.conn .check_request(self.conn.send_request_checked(&ChangeWindowAttributes { @@ -89,7 +92,7 @@ impl WM<'_> { ], }))?; - self.grabkeys()?; + self.grab_keys()?; // TODO: reset focus -- cgit v1.2.3