mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-23 04:33:05 +00:00
Improve touch input support
This commit is contained in:
parent
02fbd5f1d2
commit
0cb4c31d1e
@ -26,9 +26,7 @@
|
|||||||
UITouch *touch = [[event allTouches] anyObject];
|
UITouch *touch = [[event allTouches] anyObject];
|
||||||
CGPoint currentLocation = [touch locationInView:self];
|
CGPoint currentLocation = [touch locationInView:self];
|
||||||
|
|
||||||
NSLog(@"Touch move");
|
if (touchLocation.x != currentLocation.x ||
|
||||||
|
|
||||||
if (touchLocation.x != currentLocation.x &&
|
|
||||||
touchLocation.y != currentLocation.y)
|
touchLocation.y != currentLocation.y)
|
||||||
{
|
{
|
||||||
LiSendMouseMoveEvent(touchLocation.x - currentLocation.x,
|
LiSendMouseMoveEvent(touchLocation.x - currentLocation.x,
|
||||||
@ -43,9 +41,12 @@
|
|||||||
NSLog(@"Touch up");
|
NSLog(@"Touch up");
|
||||||
|
|
||||||
if (!touchMoved) {
|
if (!touchMoved) {
|
||||||
|
NSLog(@"Sending left mouse button press");
|
||||||
|
|
||||||
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
|
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
|
||||||
|
|
||||||
usleep(50 * 1000);
|
// Wait 100 ms to simulate a real button press
|
||||||
|
usleep(100 * 1000);
|
||||||
|
|
||||||
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
|
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user