Feat/keyboard/fr azerty#200
Conversation
…ption to being an in kernel shell command
| @@ -0,0 +1,696 @@ | |||
| use super::{Keymap, KeymapSet, KeymapValue}; | |||
| use crate::driver::keyboard::ScanCodeValue; | |||
|
|
|||
There was a problem hiding this comment.
|
|
||
| pub const FR_AZERTY_KEYMAP: Keymap = { | ||
| let mut keymap = [None; 0x80]; | ||
| // Letters -------------------------------------------------------------- |
There was a problem hiding this comment.
suggestion: no need for that comment.
| pub const FR_AZERTY_KEYMAP: Keymap = { | ||
| let mut keymap = [None; 0x80]; | ||
| // Letters -------------------------------------------------------------- | ||
| keymap[ScanCodeValue::Q as usize] = Some(KeymapSet { |
There was a problem hiding this comment.
suggestion: use the same order as in the us_qwerty.rs file
ScanCodeValue::A, then ScanCodeValue::B, etc.
| alt_shift: KeymapValue::Alt('W'), | ||
| ctrl: KeymapValue::Control('W'), | ||
| }); | ||
| // Number row (digits require Shift; accents fall back to ASCII) --------- |
There was a problem hiding this comment.
suggestion: no need for that comment.
| ctrl: KeymapValue::Control('@'), | ||
| }); | ||
| keymap[ScanCodeValue::Two as usize] = Some(KeymapSet { | ||
| // é |
There was a problem hiding this comment.
suggestion: no need for that comment.
| ctrl: KeymapValue::Control('\\'), | ||
| }); | ||
| keymap[ScanCodeValue::SingleQuote as usize] = Some(KeymapSet { | ||
| // ù -> ASCII fallback 'u' |
There was a problem hiding this comment.
suggestion: no need for that comment.
| ctrl: KeymapValue::Control('@'), | ||
| }); | ||
| keymap[ScanCodeValue::Slash as usize] = Some(KeymapSet { | ||
| // § shifted -> ASCII fallback '!' |
There was a problem hiding this comment.
suggestion: no need for that comment.
| alt_shift: KeymapValue::Alt('?'), | ||
| ctrl: KeymapValue::Control('@'), | ||
| }); | ||
| // ² key had no ASCII equivalent so its disabled for now. |
There was a problem hiding this comment.
suggestion: no need for that comment.
| \tazerty\n\ | ||
| \tqwerty" |
There was a problem hiding this comment.
issue (blocking): have a single command such as set_layout [LAYOUT] to manage an arbitrary number of layouts
| }, | ||
| "azerty" => { | ||
| KEYBOARD.lock().set_azerty(); | ||
| println!("Keyboard layout set to AZERTY (fr)"); |
There was a problem hiding this comment.
suggestion: no need for print (except perhaps in case of an error)
alisterd51
left a comment
There was a problem hiding this comment.
issue (blocking): for a simple feature like this, only a single atomic commit is allowed.
Rebase to get a single commit.
Rename the PR so it matches the commit.
| alt1: KeymapValue::Alt('a'), | ||
| alt2: KeymapValue::Alt('a'), | ||
| alt_shift: KeymapValue::Alt('A'), | ||
| ctrl: KeymapValue::Control('A'), |
There was a problem hiding this comment.
question (blocking): this does not match MINIX's Ctrl key behavior (https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/minix/drivers/tty/tty/keymaps/french.src#L21C5-L21C65); are you sure about this implementation?
Adding support to azerty keyboard.
Switch to azerty layout using the command "azerty" or to qwerty using "qwerty".
Default layout is qwerty.