int reportmode = 0, clickintime;
bypass_keystate = ev.state & (ModMetaMask | ShiftMask);
+
if (!bypass_keystate)
reportmode = !! (priv_modes & PrivMode_mouse_report);
if (ev.button != MEvent.button)
MEvent.clicks = 0;
- switch (ev.button)
- {
- case Button1:
- /* allow meta + click to select rectangular areas */
- /* should be done in screen.C */
+ if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END)))
+ switch (ev.button)
+ {
+ case Button1:
+ /* allow meta + click to select rectangular areas */
+ /* should be done in screen.C */
#if ENABLE_FRILLS
- selection.rect = !!(ev.state & ModMetaMask);
+ selection.rect = !!(ev.state & ModMetaMask);
#else
- selection.rect = false;
+ selection.rect = false;
#endif
- /* allow shift+left click to extend selection */
- if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report))
- {
- if (MEvent.button == Button1 && clickintime)
- selection_rotate (ev.x, ev.y);
- else
- selection_extend (ev.x, ev.y, 1);
- }
- else
- {
- if (MEvent.button == Button1 && clickintime)
- MEvent.clicks++;
- else
- MEvent.clicks = 1;
+ /* allow shift+left click to extend selection */
+ if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report))
+ {
+ if (MEvent.button == Button1 && clickintime)
+ selection_rotate (ev.x, ev.y);
+ else
+ selection_extend (ev.x, ev.y, 1);
+ }
+ else
+ {
+ if (MEvent.button == Button1 && clickintime)
+ MEvent.clicks++;
+ else
+ MEvent.clicks = 1;
- selection_click (MEvent.clicks, ev.x, ev.y);
- }
+ selection_click (MEvent.clicks, ev.x, ev.y);
+ }
- MEvent.button = Button1;
- break;
+ MEvent.button = Button1;
+ break;
- case Button3:
- if (MEvent.button == Button3 && clickintime)
- selection_rotate (ev.x, ev.y);
- else
- selection_extend (ev.x, ev.y, 1);
+ case Button3:
+ if (MEvent.button == Button3 && clickintime)
+ selection_rotate (ev.x, ev.y);
+ else
+ selection_extend (ev.x, ev.y, 1);
- MEvent.button = Button3;
- break;
- }
- }
+ MEvent.button = Button3;
+ break;
+ }
+ }
MEvent.time = ev.time;
return;
set_hookname (SEL_EXTEND);
set_hookname (SEL_MAKE);
set_hookname (SEL_GRAB);
+ set_hookname (SEL_CLICK);
set_hookname (FOCUS_IN);
set_hookname (FOCUS_OUT);
set_hookname (VIEW_CHANGE);
set_hookname (REFRESH_BEGIN);
set_hookname (REFRESH_END);
set_hookname (KEYBOARD_COMMAND);
+ set_hookname (MOUSE_CLICK);
+ set_hookname (MOUSE_MOVE);
export_const (DEFAULT_RSTYLE);
export_const (OVERLAY_RSTYLE);
if (ROWCOL_IS_AFTER (selection.end, selection.beg))
selection.end.col--;
- selection_delimit_word (UP, &selection.beg, &selection.beg);
- selection_delimit_word (DN, &selection.end, &selection.end);
+ if (!PERL_INVOKE ((this, HOOK_SEL_EXTEND, DT_END)))
+ {
+ selection_delimit_word (UP, &selection.beg, &selection.beg);
+ selection_delimit_word (DN, &selection.end, &selection.end);
+ }
}
else if (selection.clicks == 3)
{