remove international keycodes
This commit is contained in:
@@ -99,10 +99,6 @@ mod tests {
|
||||
fn test_scan_code_to_key() {
|
||||
let mapper = TestKeyboardMapper::new();
|
||||
for scan_code in ScanCode::iter() {
|
||||
// The IntlBackslash and IntlRo keys are not mapped to any key on US layout
|
||||
if scan_code == ScanCode::IntlBackslash || scan_code == ScanCode::IntlRo {
|
||||
continue;
|
||||
}
|
||||
let mut modifiers = Modifiers::default();
|
||||
let key = mapper.scan_code_to_key(scan_code, &mut modifiers).unwrap();
|
||||
assert_eq!(key, scan_code.to_key(false));
|
||||
|
||||
@@ -148,10 +148,6 @@ pub enum ScanCode {
|
||||
Period,
|
||||
/// Slash key on the main keyboard: /
|
||||
Slash,
|
||||
/// This key is typically located near LeftShift key, varies on international keyboards: Dan: <> Dutch: ][ Ger: <> UK: \|
|
||||
IntlBackslash,
|
||||
/// Used for Brazilian /? and Japanese _ 'ro'.
|
||||
IntlRo,
|
||||
|
||||
/// Left arrow key
|
||||
Left,
|
||||
@@ -574,8 +570,6 @@ impl ScanCode {
|
||||
"/"
|
||||
}
|
||||
}
|
||||
// Standard US keyboard layout does not have these keys, so we return "unknown".
|
||||
ScanCode::IntlBackslash | ScanCode::IntlRo => "unknown",
|
||||
ScanCode::Left => "left",
|
||||
ScanCode::Up => "up",
|
||||
ScanCode::Right => "right",
|
||||
|
||||
@@ -174,8 +174,6 @@ const TYPEABLE_CODES: &[u32] = &[
|
||||
0x003b, // , Comma
|
||||
0x003c, // . Period
|
||||
0x003d, // / Slash
|
||||
0x005e, // \ IntlBackslash
|
||||
0x0061, // ro IntlRo
|
||||
];
|
||||
|
||||
#[cfg(any(feature = "wayland", feature = "x11"))]
|
||||
@@ -253,8 +251,6 @@ fn get_scan_code(scan_code: ScanCode) -> Option<u32> {
|
||||
ScanCode::Comma => 0x003b,
|
||||
ScanCode::Period => 0x003c,
|
||||
ScanCode::Slash => 0x003d,
|
||||
ScanCode::IntlBackslash => 0x005e,
|
||||
ScanCode::IntlRo => 0x0061,
|
||||
ScanCode::Left => 0x0071,
|
||||
ScanCode::Up => 0x006f,
|
||||
ScanCode::Right => 0x0072,
|
||||
|
||||
@@ -260,8 +260,6 @@ const TYPEABLE_CODES: &[u16] = &[
|
||||
0x002b, // , Comma
|
||||
0x002f, // . Period
|
||||
0x002c, // / Slash
|
||||
0x000a, // Non-US \ International backslash
|
||||
0x005e, // Non-US Ro International Ro
|
||||
];
|
||||
|
||||
fn get_scan_code(scan_code: ScanCode) -> Option<u16> {
|
||||
@@ -335,8 +333,6 @@ fn get_scan_code(scan_code: ScanCode) -> Option<u16> {
|
||||
ScanCode::Comma => 0x002b,
|
||||
ScanCode::Period => 0x002f,
|
||||
ScanCode::Slash => 0x002c,
|
||||
ScanCode::IntlBackslash => 0x000a,
|
||||
ScanCode::IntlRo => 0x005e,
|
||||
ScanCode::Left => 0x007b,
|
||||
ScanCode::Up => 0x007e,
|
||||
ScanCode::Right => 0x007c,
|
||||
|
||||
@@ -212,8 +212,6 @@ fn get_virtual_key_from_scan_code(gpui_scan_code: ScanCode) -> Result<(u32, VIRT
|
||||
ScanCode::Comma => 0x0033,
|
||||
ScanCode::Period => 0x0034,
|
||||
ScanCode::Slash => 0x0035,
|
||||
ScanCode::IntlBackslash => 0x0056,
|
||||
ScanCode::IntlRo => 0x0073,
|
||||
_ => anyhow::bail!("Unsupported scan code: {:?}", gpui_scan_code),
|
||||
};
|
||||
let virtual_key = unsafe { MapVirtualKeyW(scan_code, MAPVK_VSC_TO_VK) };
|
||||
|
||||
Reference in New Issue
Block a user