Keyboard event capture in linux (wayland/KDE)

āš“ Rust    šŸ“… 2025-12-18    šŸ‘¤ surdeus    šŸ‘ļø 6      

surdeus

I. Problem (what I hope to achieve):

  1. timed key events (ex. rapid Space fires machine-gun, slower Space fires cannon)
  2. total keyboard capture (ex. Meta brings up MyGameOptions instead of Desktop Environment launcher like it does system wide)
  3. KeyPress and KeyRelease events (ex. modiffiers A_KeyPress && B_KeyPress && SpaceKeyRelease => FireDeathStar )

II. Background (what I kindda understood so far):

  • I'm at hello word level so... be gentle.
  • I’m on linux, wayland, KDE – not interested on other platforms for now
  • crossterm and termion are close but not there all the way for my use case - pls correct me if I'm wrong
  • Games can do it full screen, Qemu can do it in a window, so I should be able to do it in a terminal emulator window also, right?
  • I’m not doing a game (the examples are just that, examples) so struggling to understand a game engine library would be too much for me
  • Thanks in advance to anyone helping but pls be aware: any response will be followed by more, even dumber questions :wink:

1 post - 1 participant

Read full topic

šŸ·ļø Rust_feed