diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-18 21:41:46 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-18 21:41:46 +0200 |
commit | 3d0f88fcf9a262680c19bd5c44e407a02c409dcf (patch) | |
tree | cfd39dbe14683e5c9fa4b24805a49c3301a10f3f /src/ios.m | |
parent | 0962147cc8fa92e5a79458bf1270ded51c9a4433 (diff) |
iOS: Working on touch event handling
Handle finger down, motion, and up events to implement basic taps, long presses, and inertia scrolling.
Much finetuning still to be done, and certain widgets like input fields and scrollbars need a direct drag mode (they were working fine via the "mouse" events already).
Diffstat (limited to 'src/ios.m')
-rw-r--r-- | src/ios.m | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -21,3 +21,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | 21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
22 | 22 | ||
23 | #include "ios.h" | 23 | #include "ios.h" |
24 | |||
25 | #include <SDL_events.h> | ||
26 | |||
27 | static void enableMouse_(iBool yes) { | ||
28 | SDL_EventState(SDL_MOUSEBUTTONDOWN, yes); | ||
29 | SDL_EventState(SDL_MOUSEMOTION, yes); | ||
30 | SDL_EventState(SDL_MOUSEBUTTONUP, yes); | ||
31 | } | ||
32 | |||
33 | void setupApplication_iOS(void) { | ||
34 | enableMouse_(iFalse); | ||
35 | } | ||