mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-14 08:00:50 +02:00
Pointer: a release never wakes the pointer
Any "btn" or "scroll" from the relay woke a pointer that was off. When Frametop pauses for a game, the relay's stand_down sends the releases of the clicks held into the pause, and with its pointer already off (the idle timeout or pointer_toggle during a press) it used to send them with no "hide" after. The helper woke on them, connected the virtual controller and took the right hand role during the game. Now a button release or a scroll back to 0 0 doesn't wake it. The release is still handled as before (it ends its press, or goes to the driver), so the driver doesn't reconnect later with the button down. Outside a pause this changes one case: a mouse button let go after a moving controller released the pointer mid-press. That release used to reconnect the controller, recenter it and release there; now it updates the disconnected controller, and ft-screens still gets its "up". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a2bca336c
commit
4828dd46b5
1 file changed
+13
-2
@@ -1563,8 +1563,19 @@ int main() {
|
||||
// (Moves were taken first, above.)
|
||||
const bool mouseInput = std::strncmp(buf, "btn", 3) == 0 || std::strncmp(buf, "scroll", 6) == 0;
|
||||
if (mouseInput) lastMouse = Clock::now();
|
||||
// Any mouse input wakes the pointer (after a controller took over, or a helper restart).
|
||||
if (!active && mouseInput) wake(Clock::now());
|
||||
// Mouse input wakes the pointer (after a controller took over, or a helper restart),
|
||||
// but a release doesn't (a button up, a scroll back to 0 0): the relay sends those with
|
||||
// the pointer off when Frametop pauses for a game (input-relay.py stand_down), and
|
||||
// waking would connect the virtual controller during the game. The release is still
|
||||
// handled below (it ends its press, or goes to the driver), so no button stays down.
|
||||
{
|
||||
char name[16];
|
||||
int v = 1;
|
||||
double sx = 1, sy = 1;
|
||||
const bool release = (std::sscanf(buf, "btn %15s %d", name, &v) == 2 && v == 0) ||
|
||||
(std::sscanf(buf, "scroll %lf %lf", &sx, &sy) == 2 && sx == 0 && sy == 0);
|
||||
if (!active && mouseInput && !release) wake(Clock::now());
|
||||
}
|
||||
char key[128];
|
||||
double px, py, pz, pyaw, ppitch, proll = 0, pgrab = -1;
|
||||
if (std::sscanf(buf, "grabprobe %127s", key) == 1) {
|
||||
|
||||
Reference in new issue
Block a user