2023-05-18 19:32:29 +02:00
|
|
|
/*
|
|
|
|
* InputSourceKeyboard.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct SDL_KeyboardEvent;
|
|
|
|
|
2023-05-20 00:51:10 +02:00
|
|
|
/// Class that handles keyboard input from SDL events
|
2023-05-18 19:32:29 +02:00
|
|
|
class InputSourceKeyboard
|
|
|
|
{
|
2024-05-07 10:55:41 +02:00
|
|
|
std::string getKeyNameWithModifiers(const std::string & keyName) const;
|
2023-05-18 19:32:29 +02:00
|
|
|
public:
|
2023-05-19 17:56:20 +02:00
|
|
|
InputSourceKeyboard();
|
|
|
|
|
2023-05-18 19:32:29 +02:00
|
|
|
void handleEventKeyDown(const SDL_KeyboardEvent & current);
|
|
|
|
void handleEventKeyUp(const SDL_KeyboardEvent & current);
|
2023-05-26 14:57:53 +02:00
|
|
|
|
|
|
|
bool isKeyboardAltDown() const;
|
2024-05-12 19:09:31 +02:00
|
|
|
bool isKeyboardCmdDown() const;
|
2023-05-26 14:57:53 +02:00
|
|
|
bool isKeyboardCtrlDown() const;
|
|
|
|
bool isKeyboardShiftDown() const;
|
2023-05-18 19:32:29 +02:00
|
|
|
};
|