| @@ -236,6 +236,9 @@ void lglw_keyboard_callback_set (lglw_t _lglw, lglw_keyboard_fxn_t _cbk); | |||||
| // Get current key modifier state | // Get current key modifier state | ||||
| uint32_t lglw_keyboard_get_modifiers (lglw_t _lglw); | uint32_t lglw_keyboard_get_modifiers (lglw_t _lglw); | ||||
| // Clear current key modifier state (workaround for stuck-modifier-after-dialog issue) | |||||
| void lglw_keyboard_clear_modifiers (lglw_t _lglw); | |||||
| // Get current mouse button state | // Get current mouse button state | ||||
| uint32_t lglw_mouse_get_buttons (lglw_t _lglw); | uint32_t lglw_mouse_get_buttons (lglw_t _lglw); | ||||
| @@ -1722,6 +1722,17 @@ uint32_t lglw_keyboard_get_modifiers(lglw_t _lglw) { | |||||
| } | } | ||||
| // ---------------------------------------------------------------------------- lglw_keyboard_clear_modifiers | |||||
| void lglw_keyboard_clear_modifiers(lglw_t _lglw) { | |||||
| LGLW(_lglw); | |||||
| if(NULL != lglw) | |||||
| { | |||||
| lglw->keyboard.kmod_state = 0; | |||||
| } | |||||
| } | |||||
| // ---------------------------------------------------------------------------- lglw_touchkeyboard_show | // ---------------------------------------------------------------------------- lglw_touchkeyboard_show | ||||
| void lglw_touchkeyboard_show(lglw_t _lglw, lglw_bool_t _bEnable) { | void lglw_touchkeyboard_show(lglw_t _lglw, lglw_bool_t _bEnable) { | ||||
| LGLW(_lglw); | LGLW(_lglw); | ||||
| @@ -25,6 +25,7 @@ | |||||
| * ---- | * ---- | ||||
| * ---- created: 04Aug2018 | * ---- created: 04Aug2018 | ||||
| * ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 07Mar2019 | * ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 07Mar2019 | ||||
| * ---- 10Mar2019 | |||||
| * ---- | * ---- | ||||
| * ---- | * ---- | ||||
| * ---- | * ---- | ||||
| @@ -782,6 +783,18 @@ uint32_t lglw_keyboard_get_modifiers(lglw_t _lglw) { | |||||
| } | } | ||||
| // ---------------------------------------------------------------------------- lglw_keyboard_clear_modifiers | |||||
| void lglw_keyboard_clear_modifiers(lglw_t _lglw) { | |||||
| LGLW(_lglw); | |||||
| if(NULL != lglw) | |||||
| { | |||||
| lglw->keyboard.kmod_state = 0; | |||||
| } | |||||
| } | |||||
| // ---------------------------------------------------------------------------- loc_touchkeyboard_get_rect | // ---------------------------------------------------------------------------- loc_touchkeyboard_get_rect | ||||
| #if 0 | #if 0 | ||||
| static lglw_bool_t loc_touchkeyboard_get_rect(RECT *rect) { | static lglw_bool_t loc_touchkeyboard_get_rect(RECT *rect) { | ||||
| @@ -79,21 +79,27 @@ void RackScene::onHoverKey(EventHoverKey &e) { | |||||
| } | } | ||||
| break; | break; | ||||
| case 'o'/*GLFW_KEY_O*/: | case 'o'/*GLFW_KEY_O*/: | ||||
| case 'O'/*GLFW_KEY_O*/: | |||||
| if (windowIsModPressed() && !windowIsShiftPressed()) { | if (windowIsModPressed() && !windowIsShiftPressed()) { | ||||
| lglw_keyboard_clear_modifiers(global_ui->window.lglw); // workaround for stuck modifier keys | |||||
| global_ui->app.gRackWidget->openDialog(); | global_ui->app.gRackWidget->openDialog(); | ||||
| e.consumed = true; | e.consumed = true; | ||||
| } | } | ||||
| if (windowIsModPressed() && windowIsShiftPressed()) { | if (windowIsModPressed() && windowIsShiftPressed()) { | ||||
| lglw_keyboard_clear_modifiers(global_ui->window.lglw); // workaround for stuck modifier keys | |||||
| global_ui->app.gRackWidget->revert(); | global_ui->app.gRackWidget->revert(); | ||||
| e.consumed = true; | e.consumed = true; | ||||
| } | } | ||||
| break; | break; | ||||
| case 's'/*GLFW_KEY_S*/: | case 's'/*GLFW_KEY_S*/: | ||||
| case 'S'/*GLFW_KEY_S*/: | |||||
| if (windowIsModPressed() && !windowIsShiftPressed()) { | if (windowIsModPressed() && !windowIsShiftPressed()) { | ||||
| lglw_keyboard_clear_modifiers(global_ui->window.lglw); // workaround for stuck modifier keys | |||||
| global_ui->app.gRackWidget->saveDialog(); | global_ui->app.gRackWidget->saveDialog(); | ||||
| e.consumed = true; | e.consumed = true; | ||||
| } | } | ||||
| if (windowIsModPressed() && windowIsShiftPressed()) { | if (windowIsModPressed() && windowIsShiftPressed()) { | ||||
| lglw_keyboard_clear_modifiers(global_ui->window.lglw); // workaround for stuck modifier keys | |||||
| global_ui->app.gRackWidget->saveAsDialog(); | global_ui->app.gRackWidget->saveAsDialog(); | ||||
| e.consumed = true; | e.consumed = true; | ||||
| } | } | ||||
| @@ -90,7 +90,7 @@ struct SaveAsButton : TooltipIconButton { | |||||
| struct RevertButton : TooltipIconButton { | struct RevertButton : TooltipIconButton { | ||||
| RevertButton() { | RevertButton() { | ||||
| setSVG(SVG::load(assetGlobal("res/icons/noun_1084369_cc.svg"))); | setSVG(SVG::load(assetGlobal("res/icons/noun_1084369_cc.svg"))); | ||||
| tooltipText = "Revert"; | |||||
| tooltipText = "Revert (" WINDOW_MOD_KEY_NAME "+Shift+O)"; | |||||
| } | } | ||||
| void onAction(EventAction &e) override { | void onAction(EventAction &e) override { | ||||
| global_ui->app.gRackWidget->revert(); | global_ui->app.gRackWidget->revert(); | ||||