tests: add some on mouse reporting in mode "all", utf8 reporting

This commit is contained in:
Boris Faure 2019-03-03 22:49:34 +01:00
parent c9b5c52a5d
commit c462dce26d
2 changed files with 193 additions and 1 deletions

View File

@ -0,0 +1,191 @@
#!/bin/sh
# char width: 7
# char height: 15
# resize window
#resize window to 180-chars width
printf '\033[8;;180;t'
# force render
printf '\033}tr\0'
sleep 0.2
# fill space with E
printf '\033#8'
# set color
printf '\033[46;31;3m'
# positions used are;
# - 200;130 -> 9;29
# - 480;130 -> 9;69
# - 1230;130 -> 9;176
# indicate the positions to help testing
printf '\033[9;29H#'
printf '\033[9;69H#'
printf '\033[9;95H@' # after that one, MOUSE_X10 is not working
printf '\033[9;176H#'
# set mouse mode - normal reported - utf8 reporting
printf '\033[?1006l'
printf '\033[?1015l'
printf '\033[?1003h'
printf '\033[?1005h'
printf '\033[H'
## LEFT CLICK
# should print ^[[M =)^[[M@Q)^[[M@e)^[[M#e)
# move cursor
printf '\033[1H'
# mouse down
printf '\033}td;200;130;1;0;0\0'
# mouse move
printf '\033}tm;340;130;0\0'
printf '\033}tm;480;130;0\0'
# mouse up
printf '\033}tu;480;130;1;0;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;0\0'
printf '\033}tm;200;130;0\0'
# mouse click
printf '\033}td;480;130;1;0;0\0'
# mouse move -> ^[[M e)
printf '\033}tm;657;130;0\0'
# mouse move at x:94 -> ^[[M@^?)
printf '\033}tm;664;130;0\0'
# mouse move at x:95 -> ^[[M@€)
printf '\033}tm;671;130;0\0'
# mouse move at x:174 -> ^[[M@Đ)
printf '\033}tm;1230;130;0\0'
# mouse up at x:174: -> ^[[M#Đ)
printf '\033}tu;1230;130;1;0;0\0'
#not pressed
# mouse click at x:95 -> ^[[M?€)
printf '\033}tm;671;130;0\0'
# mouse click at x:94 -> ^[[M?^?)
printf '\033}tm;664;130;0\0'
# mouse click at x:93 -> ^[[M?~)
printf '\033}tm;657;130;0\0'
# force render
printf '\033}tr\0'
sleep 0.2
## RIGHT CLICK
# should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
# move cursor
printf '\033[2H'
# mouse down
printf '\033}td;200;130;3;0;0\0'
# mouse move
printf '\033}tm;340;130;0\0'
printf '\033}tm;480;130;0\0'
# mouse up
printf '\033}tu;480;130;3;0;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;0\0'
printf '\033}tm;200;130;0\0'
# force render
printf '\033}tr\0'
sleep 0.2
## MIDDLE CLICK
# should print ^[[M!=)^[[MAe)^[[M#e)
# move cursor
printf '\033[3H'
# mouse down
printf '\033}td;200;130;2;0;0\0'
# mouse move
printf '\033}tm;480;130;0\0'
# mouse up
printf '\033}tu;480;130;2;0;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;0\0'
printf '\033}tm;200;130;0\0'
# force render
printf '\033}tr\0'
sleep 0.2
## WHEEL
# prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
# move cursor
printf '\033[4H'
# wheel up/down
printf '\033}tw;200;130;1;1;0\0'
printf '\033}tw;200;130;0;1;0\0'
printf '\033}tw;480;130;1;1;0\0'
printf '\033}tw;480;130;0;1;0\0'
# force render
printf '\033}tr\0'
sleep 0.2
##
# Same with Alt
##
printf '\033[6HWith Alt:'
## LEFT CLICK
# should print ^[[M(=)^[[M@e^[[M+e)
# move cursor
printf '\033[7H'
# mouse down
printf '\033}td;200;130;1;1;0\0'
# mouse move
printf '\033}tm;480;130;1\0'
# mouse up
printf '\033}tu;480;130;1;1;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;1\0'
printf '\033}tm;200;130;1\0'
# force render
printf '\033}tr\0'
sleep 0.2
## RIGHT CLICK
# should print ^[[M*=)^[[MBe)^[[M+e)
# move cursor
printf '\033[8H'
# mouse down
printf '\033}td;200;130;3;1;0\0'
# mouse move
printf '\033}tm;480;130;1\0'
# mouse up
printf '\033}tu;480;130;3;1;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;1\0'
printf '\033}tm;200;130;1\0'
# force render
printf '\033}tr\0'
sleep 0.2
## MIDDLE CLICK
# should print ^[[M)=)^[[MAe^[[M+e
# move cursor
printf '\033[9H'
# mouse down
printf '\033}td;200;130;2;1;0\0'
# mouse move
printf '\033}tm;480;130;1\0'
# mouse up
printf '\033}tu;480;130;2;1;0\0'
# mouse move back ^[[M?Q)^[[M?=)
printf '\033}tm;340;130;1\0'
printf '\033}tm;200;130;1\0'
# force render
printf '\033}tr\0'
sleep 0.2
## WHEEL
# prints ^[[M`=)^[[M+e)
# move cursor
printf '\033[10H'
# wheel up/down
printf '\033}tw;200;130;1;1;1\0'
printf '\033}tu;480;130;0;1;1\0'
# force render
printf '\033}tr\0'
sleep 0.2
printf '\033[14H'

View File

@ -103,7 +103,8 @@ selection_box_to_paragraph.sh 7b918d2af64eef1ecb39a0f45cf72f2d
selection_invalidation_line_removed.sh 8d689636f976b044dfbf6af6b3333093
resize_window_no_content_change.sh 28d45fe49c686c8c98631cce8e4bd368
mouse_reporting_mode_x10_ext_none.sh b56ef7d0e2cc236e31ff2e149528833b
mouse_reporting_mode_x10_ext_utf8.sh c503d835cde7b0d147ae7a61e1b44fd1
mouse_reporting_mode_normal_ext_none.sh 56cb28ca5427a0b0a97642ccdba5464d
mouse_reporting_mode_x10_ext_utf8.sh c503d835cde7b0d147ae7a61e1b44fd1
mouse_reporting_mode_normal_ext_utf8.sh 7acfea21b2fd997436d4fbee7610a9f9
mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh e5169c67f10ccc035089bf49ba9e1fa2
mouse_reporting_mode_all_ext_utf8.sh 2d828e122ff45b29fa99094208164f27