Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zbyna committed May 14, 2024
1 parent 8f08fba commit c29f9ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/platform_impl/windows/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use windows_sys::Win32::{
},
};

use smol_str::SmolStr;
use smol_str::{SmolStr, ToSmolStr};
use unicode_segmentation::UnicodeSegmentation;

use crate::{
Expand Down Expand Up @@ -265,7 +265,11 @@ impl KeyEventBuilder {
let num_lock_on = kbd_state[VK_NUMLOCK as usize] & 1 != 0;
let vkey = event_info.vkey;
let physical_key = &event_info.physical_key;
let key = layout.get_key(mod_no_ctrl, num_lock_on, vkey, physical_key);
let key = match physical_key {
PhysicalKey::Code(KeyCode::BracketRight) => Key::Character("]".to_smolstr()),
PhysicalKey::Code(KeyCode::BracketLeft) => Key::Character("[".to_smolstr()),
_ => layout.get_key(mod_no_ctrl, num_lock_on, vkey, physical_key),
};
event_info.text = PartialText::Text(key.to_text().map(SmolStr::new));
}
let ev = event_info.finalize();
Expand Down

0 comments on commit c29f9ad

Please sign in to comment.