Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard shortcuts: Integrate with compositor. #68

Open
3 tasks
Sammy99jsp opened this issue Jan 29, 2023 · 3 comments
Open
3 tasks

Keyboard shortcuts: Integrate with compositor. #68

Sammy99jsp opened this issue Jan 29, 2023 · 3 comments
Assignees
Labels
configuration enhancement New feature or request

Comments

@Sammy99jsp
Copy link
Member

Sammy99jsp commented Jan 29, 2023

  • Add keyboard shortcuts to the default config.
  • Parse the keyboard shortcuts into the combinations of ModifierState and key-codes (u32s)
  • Incorporate these into the compositor, with a friendly interface.
@Sammy99jsp Sammy99jsp added enhancement New feature or request configuration labels Jan 29, 2023
@Sammy99jsp Sammy99jsp self-assigned this Jan 29, 2023
@Sammy99jsp
Copy link
Member Author

Such an interface could be an extension to the ConfigurationSection macro, combined with a revision to AvKeys.

@Sammy99jsp
Copy link
Member Author

In terms of code, we need:

  • Uncomplicated syntax
  • Easily Expandable
  • Integrate with our configuration system
  • Be interoperable with xkbcommon

@Sammy99jsp
Copy link
Member Author

Sammy99jsp commented Feb 1, 2023

So, I am proposing:

  • An enum AvKey -- Represents a key (Key(...)); a key parameter Parameter(AvKeyParam); or a raw X11 keycode (X11(u32))).
  • An enum AvKeyParam to represent the key parameters.
  • A trait (AvKeyShortcut),
  • An attribute macro AvShortcut.

The AvShortcut macro generates an implementation of AvKeyShortcut for a particular action:

#[AvShortcut(Logo+{d})]
fn switch_window<B: 'static>(state : &mut Navda<B>, params : &[AvKeyParam]) {
    state.space.elements().nth(params[0].value()).focus();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant