Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
py -m venv .venv
.venv\Scripts\activate.ps1
py -m pip install gvsbuild
gvsbuild build --msys-dir=C:\msys64 gtk4 libadwaita librsvg
gvsbuild build --vs-ver vs2026 --msys-dir=C:\msys64 gtk4 libadwaita librsvg
- name: cargo build
if: matrix.job == 'build'
run: cargo build
Expand Down
21 changes: 15 additions & 6 deletions input-emulation/src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,21 @@ impl Emulation for MacOSEmulation {
key,
state,
} => {
let code = match KeyMap::from_key_mapping(KeyMapping::Evdev(key as u16)) {
Ok(k) => k.mac as CGKeyCode,
Err(_) => {
log::warn!("unable to map key event");
return Ok(());
}
// Fallback table for Linux evdev keys that have no macOS CGKeyCode in
// the keycode crate's Chromium-derived table. F13/F14/F15 are the
// conventional macOS stand-ins for Print Screen / Scroll Lock / Pause,
// which do not exist on Apple keyboards.
let code: CGKeyCode = match scancode::Linux::try_from(key) {
Ok(scancode::Linux::KeySysrq) => 0x69, // F13
Ok(scancode::Linux::KeyScrollLock) => 0x6B, // F14
Ok(scancode::Linux::KeyPause) => 0x71, // F15
_ => match KeyMap::from_key_mapping(KeyMapping::Evdev(key as u16)) {
Comment on lines +491 to +495
Ok(k) => k.mac as CGKeyCode,
Err(_) => {
log::warn!("unable to map key event");
return Ok(());
}
},
};
let is_modifier = update_modifiers(&self.modifier_state, key, state);
if is_modifier {
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ impl Config {
}

pub fn read_from_disk(&mut self) -> Result<bool, io::Error> {
log::info!("reading config from {:?}", &self.config_path);
log::info!("reading config from {:?}", self.config_path);

let current_config = fs::read_to_string(&self.config_path)?;
let current_config = match current_config.parse::<DocumentMut>() {
Expand Down Expand Up @@ -548,7 +548,7 @@ impl Config {
}

pub fn write_back(&mut self) -> Result<(), io::Error> {
log::info!("writing config to {:?}", &self.config_path);
log::info!("writing config to {:?}", self.config_path);
/* the new config */
let new_config = self.config_toml.clone().unwrap_or_default();
let new_config = toml_edit::ser::to_string_pretty(&new_config).expect("config");
Expand Down
Loading