Implement xterm extended mouse mode
This commit is contained in:
committed by
Keith Winstein
parent
5ef7f43479
commit
926bbcc746
@@ -298,6 +298,12 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
|
|||||||
frame.append( f.ds.xterm_mouse ? "\033[?1002h" : "\033[?1002l" );
|
frame.append( f.ds.xterm_mouse ? "\033[?1002h" : "\033[?1002l" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* has xterm mouse mode changed (SET_ANY_EVENT_MOUSE)? */
|
||||||
|
if ( (!initialized)
|
||||||
|
|| (f.ds.xterm_extended_mouse != frame.last_frame.ds.xterm_extended_mouse) ) {
|
||||||
|
frame.append( f.ds.xterm_extended_mouse ? "\033[?1006h" : "\033[?1006l" );
|
||||||
|
}
|
||||||
|
|
||||||
return frame.str;
|
return frame.str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ DrawState::DrawState( int s_width, int s_height )
|
|||||||
renditions( 0 ), save(),
|
renditions( 0 ), save(),
|
||||||
next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ),
|
next_print_will_wrap( false ), origin_mode( false ), auto_wrap_mode( true ),
|
||||||
insert_mode( false ), cursor_visible( true ), reverse_video( false ),
|
insert_mode( false ), cursor_visible( true ), reverse_video( false ),
|
||||||
bracketed_paste( false ), xterm_mouse( false ),
|
bracketed_paste( false ), xterm_mouse( false ), xterm_extended_mouse( false ),
|
||||||
application_mode_cursor_keys( false )
|
application_mode_cursor_keys( false )
|
||||||
{
|
{
|
||||||
reinitialize_tabs( 0 );
|
reinitialize_tabs( 0 );
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ namespace Terminal {
|
|||||||
bool reverse_video;
|
bool reverse_video;
|
||||||
bool bracketed_paste;
|
bool bracketed_paste;
|
||||||
bool xterm_mouse;
|
bool xterm_mouse;
|
||||||
|
bool xterm_extended_mouse;
|
||||||
|
|
||||||
bool application_mode_cursor_keys;
|
bool application_mode_cursor_keys;
|
||||||
|
|
||||||
@@ -240,7 +241,8 @@ namespace Terminal {
|
|||||||
return ( width == x.width ) && ( height == x.height ) && ( cursor_col == x.cursor_col )
|
return ( width == x.width ) && ( height == x.height ) && ( cursor_col == x.cursor_col )
|
||||||
&& ( cursor_row == x.cursor_row ) && ( cursor_visible == x.cursor_visible ) &&
|
&& ( cursor_row == x.cursor_row ) && ( cursor_visible == x.cursor_visible ) &&
|
||||||
( reverse_video == x.reverse_video ) && ( renditions == x.renditions ) &&
|
( reverse_video == x.reverse_video ) && ( renditions == x.renditions ) &&
|
||||||
( bracketed_paste == x.bracketed_paste ) && ( xterm_mouse == x.xterm_mouse );
|
( bracketed_paste == x.bracketed_paste ) && ( xterm_mouse == x.xterm_mouse ) &&
|
||||||
|
( xterm_extended_mouse == x.xterm_extended_mouse );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -271,6 +271,8 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
|
|||||||
case 1000: /* xterm mouse 1 (normal) */
|
case 1000: /* xterm mouse 1 (normal) */
|
||||||
case 1002: /* xterm mouse 2 (inc. button drags) */
|
case 1002: /* xterm mouse 2 (inc. button drags) */
|
||||||
return &(fb->ds.xterm_mouse);
|
return &(fb->ds.xterm_mouse);
|
||||||
|
case 1006: /* xterm extended mouse */
|
||||||
|
return &(fb->ds.xterm_extended_mouse);
|
||||||
case 2004: /* bracketed paste */
|
case 2004: /* bracketed paste */
|
||||||
return &(fb->ds.bracketed_paste);
|
return &(fb->ds.bracketed_paste);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user