* fhandler_console.cc (read): Detect and handle mouse wheel scrolling
events (for completion of mouse reporting mode 1000) and mouse movement events (for additional mouse reporting modes 1002 and 1003). Use mouse_aware() as a guard and only condition for mouse reporting in order to enforce consistence of read() and select(). Add focus reports (for additional focus reporting mode 1004). (mouse_aware): Enable detection of additional mouse events for select(). Tune function to precisely match actual reporting criteria. Move adjustment of mouse position (by window scroll offset) here to avoid duplicate code. (char_command): Initialization of enhanced mouse reporting modes. Initialization of focus reporting mode. * fhandler.h (use_mouse): Change flag (bool->int) to indicate additional mouse modes. Add flag to indicate focus reporting. (mouse_aware): Move enhanced function into fhandler_console.cc. * select.cc (peek_console): Use modified mouse_aware() for more general detection of mouse events. Also check for focus reports.
This commit is contained in:
@ -936,11 +936,15 @@ class dev_console
|
||||
} info;
|
||||
|
||||
COORD dwLastCursorPosition;
|
||||
DWORD dwLastButtonState;
|
||||
COORD dwMousePosition; /* scroll-adjusted coord of mouse event */
|
||||
COORD dwLastMousePosition; /* scroll-adjusted coord of previous mouse event */
|
||||
DWORD dwLastButtonState; /* (not noting mouse wheel events) */
|
||||
int last_button_code; /* transformed mouse report button code */
|
||||
int nModifiers;
|
||||
|
||||
bool insert_mode;
|
||||
bool use_mouse;
|
||||
int use_mouse;
|
||||
bool use_focus;
|
||||
bool raw_win32_keyboard_mode;
|
||||
|
||||
inline UINT get_console_cp ();
|
||||
@ -1012,7 +1016,8 @@ class fhandler_console: public fhandler_termios
|
||||
|
||||
int ioctl (unsigned int cmd, void *);
|
||||
int init (HANDLE, DWORD, mode_t);
|
||||
bool mouse_aware () {return dev_state->use_mouse;}
|
||||
bool mouse_aware (MOUSE_EVENT_RECORD& mouse_event);
|
||||
bool focus_aware () {return dev_state->use_focus;}
|
||||
|
||||
select_record *select_read (select_stuff *);
|
||||
select_record *select_write (select_stuff *);
|
||||
|
Reference in New Issue
Block a user