if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
{
+# ifdef FEAT_TERMINAL
+ if (term_use_loop())
+ send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
+ else
+# endif
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
{
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
int term_job_running(term_T *term);
int term_in_terminal_mode(void);
void term_leave_terminal_mode(void);
+int send_keys_to_term(term_T *term, int c, int typed);
int term_use_loop(void);
int terminal_loop(void);
void term_job_ended(job_T *job);
*
* TODO:
* - MS-Windows: no redraw for 'updatetime' #1915
- * - mouse scroll: when over other window, scroll that window.
* - add argument to term_wait() for waiting time.
* - For the scrollback buffer store lines in the buffer, only attributes in
* tl_scrollback.
* Return FAIL when the key needs to be handled in Normal mode.
* Return OK when the key was dropped or sent to the terminal.
*/
- static int
+ int
send_keys_to_term(term_T *term, int c, int typed)
{
char msg[KEY_BUF_LEN];
case K_X1RELEASE:
case K_X2MOUSE:
case K_X2RELEASE:
+
+ case K_MOUSEUP:
+ case K_MOUSEDOWN:
+ case K_MOUSELEFT:
+ case K_MOUSERIGHT:
if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < W_WINCOL(curwin)
|| mouse_col >= W_ENDCOL(curwin)
|| dragging_outside)
{
- /* click outside the current window */
+ /* click or scroll outside the current window */
if (typed)
{
stuffcharReadbuff(c);