Skip to content

Feat: Added Capslock, Alt, Home, End, Delete, Keyboard layout handling - #146

Open
frenchcast1234 wants to merge 7 commits into
Auri-OS:developfrom
frenchcast1234:issue-134
Open

frenchcast1234 wants to merge 7 commits into
Auri-OS:developfrom
frenchcast1234:issue-134

Conversation

@frenchcast1234

@frenchcast1234 frenchcast1234 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Feat/Capslock, Alt, Home, End, Delete, QWERTY, AZERTY.

Add all the points from issue #134 except the third one.

  • Capslock
  • Alt
  • Home
  • End
  • Delete
  • QWERTY and AZERTY configuration with keyboard <index>

Closes #134

@NymiiTechTips NymiiTechTips changed the title Fix #134 Feat/ Added Capslock, Alt, Home, End, Delete, Keyboard layout handling Sep 10, 2026

@pepedinho pepedinho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should restructure this before merging.

Scancodes are a byte stream/protocol, so I would expect a proper state machine here rather than having the state spread across multiple if statements and global flags (extended, shift_pressed, etc.).

Something along the lines of:

PS/2 bytes
    ↓
scancode state machine
    ↓
key events (keycode + pressed/released)
    ↓
modifiers / keyboard layout
    ↓
terminal / shell

The current implementation mixes all of these layers together, and the keyboard driver directly calls shell_*() functions. The driver should report KEY_UP, KEY_LEFT, KEY_DELETE, etc.; the shell/terminal should decide what those keys mean.

It would also make handling E0/E1, key releases, modifiers, and additional layouts much cleaner.

There is also a likely bug in the character mapping where c is assigned again unconditionally after the if/else, effectively overriding the Shift/Caps selection.

I don't think we need to over-engineer this, but I do think we should have a clear, explicit scancode state machine and keep the parsing, layout, and shell logic separated.

@NymiiTechTips NymiiTechTips changed the title Feat/ Added Capslock, Alt, Home, End, Delete, Keyboard layout handling Feat: Added Capslock, Alt, Home, End, Delete, Keyboard layout handling Sep 11, 2026

@pepedinho pepedinho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using an enum for the key states would be more expressive e.g. Pressed, Released.

Your implementation is missing a translation step.

The driver sends keyboard events (pressed/released), and you are trying to interpret them directly in the shell.

That isn't the shell's role.

You therefore need a component to act as a state machine that reads the events from the driver.

[ Keyboard ]
        │
        ▼ (Interupt / Raw Scan Code, ex: 0x1E)
[ Keyboard driver ]
        │
        ▼ (Key event : Press / Release)
[ Keymap / State Machine ] (Shift, Alt, Caps Lock, Layout AZERTY...)
        │
        ▼ (ASCII / Utf-8 or escaping sequences)
[ Shell]

@NymiiTechTips NymiiTechTips self-assigned this Oct 30, 2026
@NymiiTechTips NymiiTechTips added invalid This doesn't seem right A-CORE S-BLOCKED labels Oct 30, 2026
…eymap et keyboard (command) path file, added zoom-to-fit option to make, refactor on keyboard command arguments, added a terminal scroll, removed glitched char on keymap, refactored readme with actual changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

0.2.3 Feat : Keyboard driver upgrade

3 participants