void InputEvents::ProcessEvent(unsigned event_id) { assert(event_id != 0); InputEvents::Mode lastMode = getModeID(); int bindex = FindMenuItemByEvent(lastMode, overlay_mode, event_id); if (bindex < 0 || ButtonLabel::IsEnabled(bindex)) InputEvents::processGo(event_id); // experimental: update button text, macro may change the value if (lastMode == getModeID() && bindex > 0) drawButtons(lastMode); }
void InputEvents::setMode(Mode mode) { assert((unsigned)mode < input_config.modes.size()); if (mode == current_mode) return; current_mode = mode; UpdateOverlayMode(); drawButtons(getModeID(), true); }
void InputEvents::ProcessMenuTimer() { if (CommonInterface::main_window.HasDialog()) /* no menu updates while a dialog is visible */ return; if (MenuTimeOut == CommonInterface::GetUISettings().menu_timeout) HideMenu(); // refresh visible buttons if still visible drawButtons(getModeID()); MenuTimeOut++; }
void InputEvents::SetFlavour(const TCHAR *_flavour) { if (flavour == NULL && _flavour == NULL) /* optimised default case */ return; flavour = _flavour; const Mode old_overlay_mode = overlay_mode; UpdateOverlayMode(); if (overlay_mode != old_overlay_mode) /* the overlay_mode has changed, update the displayed menu */ drawButtons(getModeID(), true); }
/* InputEvent::processKey(KeyID); Process keys normally brought in by hardware or keyboard presses Future will also allow for long and double click presses... Return = We had a valid key (even if nothing happens because of Bounce) */ bool InputEvents::processKey(unsigned key_code) { return ProcessKey(getModeID(), key_code); }
void InputEvents::UpdatePan() { drawButtons(getModeID(), true); }