diff options
author | Peter Osterlund <petero2@telia.com> | 2003-05-02 03:12:39 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:00:53 +0200 |
commit | b41f7dda288bb959891d8684c36c56037fbef7ba (patch) | |
tree | 4fe39f4c969ed15649c9bd4e93d265173a06a242 /synaptics.h | |
parent | efe5015664abf88ab780aa47dad1a8c528d87329 (diff) |
Better state machine for handling middle mouse button
emulation.
* Clicks shorter than EmulateMidButtonTime are no longer lost.
* The middle button event is generated as soon as both the left and the
right buttons are pressed. The old code waited until the timeout had
passed before even checking if both buttons were pressed.
Diffstat (limited to 'synaptics.h')
-rw-r--r-- | synaptics.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synaptics.h b/synaptics.h index 2e6ebae..e9f9c53 100644 --- a/synaptics.h +++ b/synaptics.h @@ -53,6 +53,14 @@ typedef struct _SynapticsMoveHist int x, y; } SynapticsMoveHistRec; +enum MidButtonEmulation { + MBE_OFF, /* No button pressed */ + MBE_LEFT, /* Left button pressed, waiting for right button or timeout */ + MBE_RIGHT, /* Right button pressed, waiting for left button or timeout */ + MBE_MID /* Left and right buttons pressed, waiting for both buttons + to be released */ +}; + typedef struct _SynapticsPrivateRec { /* shared memory pointer */ @@ -87,7 +95,7 @@ typedef struct _SynapticsPrivateRec Bool vert_scroll_on; /* scrolling flag */ Bool horiz_scroll_on; /* scrolling flag */ double frac_x, frac_y; /* absoulte -> relative fraction */ - Bool third_button; /* emulated 3rd button */ + enum MidButtonEmulation mid_emu_state; /* emulated 3rd button */ OsTimerPtr repeat_timer; /* for up/down-button repeat */ int repeatButtons; /* buttons for repeat */ int lastButtons; /* last State of the buttons */ |