mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix SDL_Hints location
This commit is contained in:
@@ -313,19 +313,6 @@ int main(int argc, char * argv[])
|
|||||||
logGlobal->info("Initializing screen and sound handling: %d ms", pomtime.getDiff());
|
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
|
#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
|
//we can properly play intro only in the main thread, so we have to move loading to the separate thread
|
||||||
boost::thread loading(init);
|
boost::thread loading(init);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "../../lib/CConfigHandler.h"
|
#include "../../lib/CConfigHandler.h"
|
||||||
|
|
||||||
#include <SDL_events.h>
|
#include <SDL_events.h>
|
||||||
|
#include <SDL_hints.h>
|
||||||
|
|
||||||
InputHandler::InputHandler()
|
InputHandler::InputHandler()
|
||||||
: mouseHandler(std::make_unique<InputSourceMouse>())
|
: mouseHandler(std::make_unique<InputSourceMouse>())
|
||||||
|
|||||||
@@ -18,6 +18,15 @@
|
|||||||
#include "../gui/ShortcutHandler.h"
|
#include "../gui/ShortcutHandler.h"
|
||||||
|
|
||||||
#include <SDL_events.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)
|
void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ struct SDL_KeyboardEvent;
|
|||||||
class InputSourceKeyboard
|
class InputSourceKeyboard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
InputSourceKeyboard();
|
||||||
|
|
||||||
void handleEventKeyDown(const SDL_KeyboardEvent & current);
|
void handleEventKeyDown(const SDL_KeyboardEvent & current);
|
||||||
void handleEventKeyUp(const SDL_KeyboardEvent & current);
|
void handleEventKeyUp(const SDL_KeyboardEvent & current);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,11 +21,17 @@
|
|||||||
|
|
||||||
#include <SDL_events.h>
|
#include <SDL_events.h>
|
||||||
#include <SDL_render.h>
|
#include <SDL_render.h>
|
||||||
|
#include <SDL_hints.h>
|
||||||
|
|
||||||
InputSourceTouch::InputSourceTouch()
|
InputSourceTouch::InputSourceTouch()
|
||||||
: multifinger(false)
|
: multifinger(false)
|
||||||
, isPointerRelativeMode(settings["general"]["userRelativePointer"].Bool())
|
, 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)
|
void InputSourceTouch::handleEventFingerMotion(const SDL_TouchFingerEvent & tfinger)
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ void SelectionTab::clickLeft(tribool down, bool previousState)
|
|||||||
}
|
}
|
||||||
#ifdef VCMI_IOS
|
#ifdef VCMI_IOS
|
||||||
// focus input field if clicked inside it
|
// 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();
|
inputName->giveFocus();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user