Skip to content

Commit f027dcf

Browse files
committed
Clarified docs for 'common' mouse handling, and removed some unused code
1 parent 6306ac2 commit f027dcf

2 files changed

Lines changed: 22 additions & 14 deletions

File tree

common/mouse.c

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
/* Platform-independent parts of mouse handling. This is surprisingly
22
hard to get right.
33
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
1426
looking for clicks from that button. (If not, PDCursesMod may return a
1527
press and a click... if, again, corresponding bits are turned on.) Two
1628
clicks will be combined into a double-click, _if_ we're actually looking

vt/pdcscrn.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ static struct termios orig_term;
2323
#include "../common/pdccolor.h"
2424
#include "../common/pdccolor.c"
2525

26-
#ifdef USING_COMBINING_CHARACTER_SCHEME
27-
int PDC_expand_combined_characters( const cchar_t c, cchar_t *added);
28-
#endif
29-
3026
#ifdef DOS
3127
int PDC_is_ansi = TRUE;
3228
#else

0 commit comments

Comments
 (0)