rust-embedded-community / pc-keyboard

PS/2 Keyboard Decoder in Rust
Apache License 2.0
96 stars 28 forks source link

UK ScanCodeSet 2 errors #25

Closed thejpster closed 1 year ago

thejpster commented 1 year ago

On a PS/2 UK keyboard with 0.6.1:

thejpster commented 1 year ago
KeyCode::HashTilde => {
    if modifiers.is_shifted() {
        DecodedKey::Unicode('~')
    } else {
        DecodedKey::Unicode('#')
    }
}

should be

// Ok a UK keyboard, this is actually left of Z and has neither Hash nor Tilde on it
KeyCode::HashTilde => {
    if modifiers.is_shifted() {
        DecodedKey::Unicode('|')
    } else {
        DecodedKey::Unicode('\\')
    }
}
// This key is between Carriage Return and @
KeyCode::BackSlash => {
    if modifiers.is_shifted() {
        DecodedKey::Unicode('~')
    } else {
        DecodedKey::Unicode('#')
    }
}