|
1 | 1 | /* Platform-independent parts of mouse handling. This is surprisingly |
2 | 2 | hard to get right. |
3 | 3 |
|
4 | | - The idea here is that the various platforms detect "raw" mouse events |
5 | | -(buttons pressed and released, mouse and wheel movements) in very |
6 | | -different, platform-specific ways. But they all should use the same logic |
7 | | -to "cook" those raw events into the clicks, double-clicks, etc. that |
8 | | -the PDCursesMod library eventually returns, and to determine which events |
9 | | -get filtered. |
10 | | -
|
11 | | - This code will convert the raw event stream to "cooked" events. Some |
12 | | -events may be omitted, if the corresponding bits in SP->_trap_mbe aren't |
13 | | -set. Presses and releases will be combined into clicks _if_ we're actually |
| 4 | + The idea here is that the various platforms detect "raw" mouse |
| 5 | +events. The actual methods are, of course, platform-dependent, |
| 6 | +but the "raw" events will consist of |
| 7 | +
|
| 8 | +- button N pressed |
| 9 | +- button N released |
| 10 | +- mouse moved |
| 11 | +- wheel up/down/left/right |
| 12 | +
|
| 13 | + The actual events returned by the PDCursesMod library, however, |
| 14 | +will be the above plus "cooked" events made from presses and releases : |
| 15 | +
|
| 16 | +- button N clicked |
| 17 | +- button N double-clicked |
| 18 | +- button N triple-clicked |
| 19 | +
|
| 20 | + Some of these will be filtered, according to the bits set in |
| 21 | +SP->_trap_mbe. This code contains the (platform-independent) logic |
| 22 | +used to turn "raw" mouse events from the platform into "cooked" |
| 23 | +events returned by the library, with unwanted events filtered out. |
| 24 | +
|
| 25 | + Presses and releases will be combined into clicks _if_ we're actually |
14 | 26 | looking for clicks from that button. (If not, PDCursesMod may return a |
15 | 27 | press and a click... if, again, corresponding bits are turned on.) Two |
16 | 28 | clicks will be combined into a double-click, _if_ we're actually looking |
|
0 commit comments