Skip to content

Commit

Permalink
impl Default for AltGrBehaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Nov 15, 2023
1 parent 723e7a2 commit dd398bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion parser/src/cfg/defcfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Default for CfgOptions {
#[cfg(any(target_os = "linux", target_os = "unknown"))]
linux_x11_repeat_delay_rate: None,
#[cfg(any(target_os = "windows", target_os = "unknown"))]
windows_altgr: AltGrBehaviour::DoNothing,
windows_altgr: AltGrBehaviour::default(),
#[cfg(any(
all(feature = "interception_driver", target_os = "windows"),
target_os = "unknown"
Expand Down Expand Up @@ -333,3 +333,8 @@ pub enum AltGrBehaviour {
AddLctlRelease,
}

impl Default for AltGrBehaviour {
fn default() -> Self {
Self::DoNothing
}
}
2 changes: 1 addition & 1 deletion src/kanata/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub use self::interception::*;
static PRESSED_KEYS: Lazy<Mutex<HashSet<OsCode>>> = Lazy::new(|| Mutex::new(HashSet::default()));

pub static ALTGR_BEHAVIOUR: Lazy<Mutex<AltGrBehaviour>> =
Lazy::new(|| Mutex::new(CfgOptions::default().windows_altgr));
Lazy::new(|| Mutex::new(AltGrBehaviour::default()));

pub fn set_win_altgr_behaviour(b: AltGrBehaviour) {
*ALTGR_BEHAVIOUR.lock() = b;
Expand Down

0 comments on commit dd398bc

Please sign in to comment.