More work on Android touch events. Fixed the issues I was having with busted float coords, and added some logic for a different way to deal with selection. Doubleclicking is no longer required; instead, if you generate a finger up event within 50 pixels of where you fingered down, this will be treated as an JGE_BTN_OK event. I think this feels more natural, as you can drag around in a menu or to various cards; then when you find your selection, simply touching it again once triggers the selection.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_touch.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
|
||||
#include "SDL_androidtouch.h"
|
||||
|
||||
@@ -42,16 +43,21 @@ SDL_Touch* CreateTouchInstance()
|
||||
{
|
||||
SDL_Touch touch;
|
||||
touch.id = gTouchID;
|
||||
|
||||
touch.x_min = 0;
|
||||
touch.x_max = 1;
|
||||
touch.native_xres = touch.xres = 1;
|
||||
touch.native_xres = 1;
|
||||
touch.xres = 1;
|
||||
touch.y_min = 0;
|
||||
|
||||
touch.y_min = 0;
|
||||
touch.y_max = 1;
|
||||
touch.native_yres = touch.yres = 1;
|
||||
touch.pressure_min = 0;
|
||||
touch.native_yres = 1;
|
||||
touch.yres = 1;
|
||||
|
||||
touch.pressure_min = 0;
|
||||
touch.pressure_max = 1;
|
||||
touch.native_pressureres = touch.pressure_max - touch.pressure_min;
|
||||
touch.native_pressureres = 1;
|
||||
touch.pressureres = 1;
|
||||
|
||||
SDL_AddTouch(&touch, "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user