Skip to content

Add alt_gr key support, need some review

Jeremy Soller requested to merge meven:altgr-support into master

Created by: meven

What's in it :

  • support for the Alt_gr key for keymaps (currenty only used for the bepo keymap)
  • spilt of handle function in handle_keyboard and handle_mouse for clarity, and avoid a long function.

This could be merged but it exposes a current issue : the lack of modifier in orbclient::KeyEvent. This causes orbital to grab any alt keypress without differentiating between Alt and Alt_gr (in orbital::OrbitalScheme key_event). That's why I put an ugly return ; at line 133.

So I would like to open a discussion about revamping orbclient::KeyEvent, before moving forward.

My sense would be to add a modifier field of some sort in orbclient::KeyEvent.

#[derive(Copy, Clone, Debug)]
pub struct KeyEvent {
    /// The charecter of the key
    pub character: char,
    /// The scancode of the key
    pub scancode: u8,
    /// Was it pressed?
    pub pressed: bool,

A possible example could be like qt does using a bitflag:

Please comment

Edited by Ribbon

Merge request reports