1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:27:45 +00:00

Piano: Only treat unmodified key presses as playing notes

This makes Action shortcuts work again. :^)

`note_key_action()` and `special_key_action()` now return whether they
consumed the event. We don't even call them if any modifier keys were
held down, so things like `Ctrl+T` no longer play notes.
This commit is contained in:
Sam Atkins 2022-12-14 16:13:09 +00:00 committed by Linus Groh
parent 7c17e73c7f
commit bdd9bc16de
2 changed files with 28 additions and 15 deletions

View file

@ -39,8 +39,8 @@ private:
virtual void keyup_event(GUI::KeyEvent&) override;
virtual void custom_event(Core::CustomEvent&) override;
void note_key_action(int key_code, DSP::Keyboard::Switch);
void special_key_action(int key_code);
bool note_key_action(int key_code, DSP::Keyboard::Switch);
bool special_key_action(int key_code);
void turn_off_pressed_keys();
void turn_on_pressed_keys();