Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CHotkeyPicker.h
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public: | ||||
// Pre-empt events: this is our sole purpose. | // Pre-empt events: this is our sole purpose. | ||||
virtual InReaction PreemptEvent(const SDL_Event_* ev); | virtual InReaction PreemptEvent(const SDL_Event_* ev); | ||||
protected: | protected: | ||||
// Fire an event with m_KeysPressed as argument. | // Fire an event with m_KeysPressed as argument. | ||||
void FireEvent(const CStr& event); | void FireEvent(const CStr& event); | ||||
// Time without changes until a "combination" event is sent. | // Time without changes until a "combination" event is sent. | ||||
float m_TimeToCombination; | CGUISimpleSetting<float> m_TimeToCombination; | ||||
// Time of the last registered key change. | // Time of the last registered key change. | ||||
double m_LastKeyChange; | double m_LastKeyChange; | ||||
// Keep track of which keys we are pressing, and precompute their name for JS code. | // Keep track of which keys we are pressing, and precompute their name for JS code. | ||||
struct Key | struct Key | ||||
{ | { | ||||
// The scancode is used for fast comparisons. | // The scancode is used for fast comparisons. | ||||
SDL_Scancode code; | SDL_Scancode code; | ||||
Show All 10 Lines |
Wildfire Games · Phabricator