mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fix SDL_Hints location
This commit is contained in:
parent
bb36336aed
commit
e23dfec6c5
@ -313,19 +313,6 @@ int main(int argc, char * argv[])
|
||||
logGlobal->info("Initializing screen and sound handling: %d ms", pomtime.getDiff());
|
||||
}
|
||||
|
||||
#ifdef VCMI_MAC
|
||||
// Ctrl+click should be treated as a right click on Mac OS X
|
||||
SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1");
|
||||
#endif
|
||||
|
||||
#ifdef SDL_HINT_MOUSE_TOUCH_EVENTS
|
||||
if(settings["general"]["userRelativePointer"].Bool())
|
||||
{
|
||||
SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0");
|
||||
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef VCMI_NO_THREADED_LOAD
|
||||
//we can properly play intro only in the main thread, so we have to move loading to the separate thread
|
||||
boost::thread loading(init);
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
|
||||
#include <SDL_events.h>
|
||||
|
||||
#include <SDL_hints.h>
|
||||
|
||||
InputHandler::InputHandler()
|
||||
: mouseHandler(std::make_unique<InputSourceMouse>())
|
||||
|
@ -18,6 +18,15 @@
|
||||
#include "../gui/ShortcutHandler.h"
|
||||
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_hints.h>
|
||||
|
||||
InputSourceKeyboard::InputSourceKeyboard()
|
||||
{
|
||||
#ifdef VCMI_MAC
|
||||
// Ctrl+click should be treated as a right click on Mac OS X
|
||||
SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1");
|
||||
#endif
|
||||
}
|
||||
|
||||
void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ struct SDL_KeyboardEvent;
|
||||
class InputSourceKeyboard
|
||||
{
|
||||
public:
|
||||
InputSourceKeyboard();
|
||||
|
||||
void handleEventKeyDown(const SDL_KeyboardEvent & current);
|
||||
void handleEventKeyUp(const SDL_KeyboardEvent & current);
|
||||
};
|
||||
|
@ -21,11 +21,17 @@
|
||||
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_render.h>
|
||||
#include <SDL_hints.h>
|
||||
|
||||
InputSourceTouch::InputSourceTouch()
|
||||
: multifinger(false)
|
||||
, isPointerRelativeMode(settings["general"]["userRelativePointer"].Bool())
|
||||
{
|
||||
if(isPointerRelativeMode)
|
||||
{
|
||||
SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0");
|
||||
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
|
||||
}
|
||||
}
|
||||
|
||||
void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfinger)
|
||||
|
@ -277,7 +277,7 @@ void SelectionTab::clickLeft(tribool down, bool previousState)
|
||||
}
|
||||
#ifdef VCMI_IOS
|
||||
// focus input field if clicked inside it
|
||||
else if(inputName && inputName->active && inputNameRect.isInside(GH.getCursorPosition()))
|
||||
else if(inputName && inputName->isActive() && inputNameRect.isInside(GH.getCursorPosition()))
|
||||
inputName->giveFocus();
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user