2018-07-22 23:07:49 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* fkeyboard-test.cpp - FKeyboard unit tests *
|
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* This file is part of the FINAL CUT widget toolkit *
|
2018-07-22 23:07:49 +02:00
|
|
|
* *
|
2020-03-07 21:32:18 +01:00
|
|
|
* Copyright 2018-2020 Markus Gans *
|
2018-07-22 23:07:49 +02:00
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* FINAL CUT is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Lesser General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 3 of *
|
2018-07-22 23:07:49 +02:00
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* FINAL CUT is distributed in the hope that it will be useful, but *
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
2018-07-22 23:07:49 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this program. If not, see *
|
|
|
|
* <http://www.gnu.org/licenses/>. *
|
|
|
|
***********************************************************************/
|
|
|
|
|
2020-08-23 00:32:41 +02:00
|
|
|
#include <string>
|
|
|
|
|
2018-07-22 23:07:49 +02:00
|
|
|
#include <cppunit/BriefTestProgressListener.h>
|
|
|
|
#include <cppunit/CompilerOutputter.h>
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
#include <cppunit/TestFixture.h>
|
|
|
|
#include <cppunit/TestResult.h>
|
|
|
|
#include <cppunit/TestResultCollector.h>
|
|
|
|
#include <cppunit/TestRunner.h>
|
|
|
|
|
|
|
|
#include <final/final.h>
|
|
|
|
|
|
|
|
namespace test
|
|
|
|
{
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2020-04-24 00:34:26 +02:00
|
|
|
int num;
|
|
|
|
const char* string;
|
|
|
|
char tname[4];
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
2019-10-08 04:37:19 +02:00
|
|
|
FKeyMap;
|
2018-07-22 23:07:49 +02:00
|
|
|
|
2019-10-08 04:37:19 +02:00
|
|
|
FKeyMap fkey[] =
|
2018-07-22 23:07:49 +02:00
|
|
|
{
|
2020-04-25 02:32:33 +02:00
|
|
|
{ finalcut::fc::Fkey_backspace , "\177" , "kb" }, // backspace key
|
|
|
|
{ finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key
|
|
|
|
{ finalcut::fc::Fkey_clear , 0 , "kC" }, // clear-screen or erase key
|
|
|
|
{ finalcut::fc::Fkey_ctab , CSI "3~" , "kt" }, // clear-tab key
|
|
|
|
{ finalcut::fc::Fkey_dc , 0 , "kD" }, // delete-character key
|
|
|
|
{ finalcut::fc::Fkey_dc , 0 , "kDx" }, // delete-character key
|
|
|
|
{ finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key
|
|
|
|
{ finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key
|
|
|
|
{ finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode
|
|
|
|
{ finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key
|
|
|
|
{ finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key
|
|
|
|
{ finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key
|
|
|
|
{ finalcut::fc::Fkey_f1 , ESC "OP" , "k1" }, // F1 function key
|
|
|
|
{ finalcut::fc::Fkey_f2 , ESC "OQ" , "k2" }, // F2 function key
|
|
|
|
{ finalcut::fc::Fkey_f3 , ESC "OR" , "k3" }, // F3 function key
|
|
|
|
{ finalcut::fc::Fkey_f4 , ESC "OS" , "k4" }, // F4 function key
|
|
|
|
{ finalcut::fc::Fkey_f5 , CSI "15~" , "k5" }, // F5 function key
|
|
|
|
{ finalcut::fc::Fkey_f6 , CSI "17~" , "k6" }, // F6 function key
|
|
|
|
{ finalcut::fc::Fkey_f7 , CSI "18~" , "k7" }, // F7 function key
|
|
|
|
{ finalcut::fc::Fkey_f8 , CSI "19~" , "k8" }, // F8 fucntion key
|
|
|
|
{ finalcut::fc::Fkey_f9 , CSI "20~" , "k9" }, // F9 function key
|
|
|
|
{ finalcut::fc::Fkey_f10 , CSI "21~" , "k;" }, // F10 function key
|
|
|
|
{ finalcut::fc::Fkey_home , ESC "OH" , "kh" }, // home key
|
|
|
|
{ finalcut::fc::Fkey_ic , CSI "2~" , "kI" }, // insert-character key
|
|
|
|
{ finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key
|
|
|
|
{ finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key
|
|
|
|
{ finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key
|
|
|
|
{ finalcut::fc::Fkey_npage , CSI "6~" , "kN" }, // next-page key
|
|
|
|
{ finalcut::fc::Fkey_ppage , CSI "5~" , "kP" }, // prev-page key
|
|
|
|
{ finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key
|
|
|
|
{ finalcut::fc::Fkey_sf , CSI "1;2B" , "kF" }, // scroll-forward key (shift-up)
|
|
|
|
{ finalcut::fc::Fkey_sr , CSI "1;2A" , "kR" }, // scroll-backward key (shift-down)
|
|
|
|
{ finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key
|
|
|
|
{ finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key
|
|
|
|
{ finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad
|
|
|
|
{ finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad
|
|
|
|
{ finalcut::fc::Fkey_b2 , CSI "E" , "K2" }, // center of keypad
|
|
|
|
{ finalcut::fc::Fkey_c1 , 0 , "K4" }, // lower left of keypad
|
|
|
|
{ finalcut::fc::Fkey_c3 , 0 , "K5" }, // lower right of keypad
|
|
|
|
{ finalcut::fc::Fkey_btab , CSI "Z" , "kB" }, // back-tab key
|
|
|
|
{ finalcut::fc::Fkey_beg , 0 , "@1" }, // begin key
|
|
|
|
{ finalcut::fc::Fkey_cancel , 0 , "@2" }, // cancel key
|
|
|
|
{ finalcut::fc::Fkey_close , 0 , "@3" }, // close key
|
|
|
|
{ finalcut::fc::Fkey_command , 0 , "@4" }, // command key
|
|
|
|
{ finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key
|
|
|
|
{ finalcut::fc::Fkey_create , 0 , "@6" }, // create key
|
|
|
|
{ finalcut::fc::Fkey_end , ESC "OF" , "@7" }, // end key
|
|
|
|
{ finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key
|
|
|
|
{ finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key
|
|
|
|
{ finalcut::fc::Fkey_find , CSI "1~" , "@0" }, // find key
|
|
|
|
{ finalcut::fc::Fkey_help , 0 , "%1" }, // help key
|
|
|
|
{ finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key
|
|
|
|
{ finalcut::fc::Fkey_message , 0 , "%3" }, // message key
|
|
|
|
{ finalcut::fc::Fkey_move , 0 , "%4" }, // move key
|
|
|
|
{ finalcut::fc::Fkey_next , 0 , "%5" }, // next key
|
|
|
|
{ finalcut::fc::Fkey_open , 0 , "%6" }, // open key
|
|
|
|
{ finalcut::fc::Fkey_options , 0 , "%7" }, // options key
|
|
|
|
{ finalcut::fc::Fkey_previous , 0 , "%8" }, // previous key
|
|
|
|
{ finalcut::fc::Fkey_print , 0 , "%9" }, // print key
|
|
|
|
{ finalcut::fc::Fkey_redo , 0 , "%0" }, // redo key
|
|
|
|
{ finalcut::fc::Fkey_reference , 0 , "&1" }, // reference key
|
|
|
|
{ finalcut::fc::Fkey_refresh , 0 , "&2" }, // refresh key
|
|
|
|
{ finalcut::fc::Fkey_replace , 0 , "&3" }, // replace key
|
|
|
|
{ finalcut::fc::Fkey_restart , 0 , "&4" }, // restart key
|
|
|
|
{ finalcut::fc::Fkey_resume , 0 , "&5" }, // resume key
|
|
|
|
{ finalcut::fc::Fkey_save , 0 , "&6" }, // save key
|
|
|
|
{ finalcut::fc::Fkey_suspend , 0 , "&7" }, // suspend key
|
|
|
|
{ finalcut::fc::Fkey_undo , 0 , "&8" }, // undo key
|
|
|
|
{ finalcut::fc::Fkey_sbeg , 0 , "&9" }, // shifted begin key
|
|
|
|
{ finalcut::fc::Fkey_scancel , 0 , "&0" }, // shifted cancel key
|
|
|
|
{ finalcut::fc::Fkey_scommand , 0 , "*1" }, // shifted command key
|
|
|
|
{ finalcut::fc::Fkey_scopy , 0 , "*2" }, // shifted copy key
|
|
|
|
{ finalcut::fc::Fkey_screate , 0 , "*3" }, // shifted create key
|
|
|
|
{ finalcut::fc::Fkey_sdc , CSI "3;2~" , "*4" }, // shifted delete-character key
|
|
|
|
{ finalcut::fc::Fkey_sdl , 0 , "*5" }, // shifted delete-line key
|
|
|
|
{ finalcut::fc::Fkey_select , CSI "4~" , "*6" }, // select key
|
|
|
|
{ finalcut::fc::Fkey_send , CSI "1;2F" , "*7" }, // shifted end key
|
|
|
|
{ finalcut::fc::Fkey_seol , 0 , "*8" }, // shifted clear-to-end-of-line key
|
|
|
|
{ finalcut::fc::Fkey_sexit , 0 , "*9" }, // shifted exit key
|
|
|
|
{ finalcut::fc::Fkey_sfind , 0 , "*0" }, // shifted find key
|
|
|
|
{ finalcut::fc::Fkey_shelp , 0 , "#1" }, // shifted help key
|
|
|
|
{ finalcut::fc::Fkey_shome , CSI "1;2H" , "#2" }, // shifted home key
|
|
|
|
{ finalcut::fc::Fkey_sic , CSI "2;2~" , "#3" }, // shifted insert-character key
|
|
|
|
{ finalcut::fc::Fkey_sleft , CSI "1;2D" , "#4" }, // shifted left-arrow key
|
|
|
|
{ finalcut::fc::Fkey_smessage , 0 , "%a" }, // shifted message key
|
|
|
|
{ finalcut::fc::Fkey_smove , 0 , "%b" }, // shifted move key
|
|
|
|
{ finalcut::fc::Fkey_snext , CSI "6;2~" , "%c" }, // shifted next key
|
|
|
|
{ finalcut::fc::Fkey_soptions , 0 , "%d" }, // shifted options key
|
|
|
|
{ finalcut::fc::Fkey_sprevious , CSI "5;2~" , "%e" }, // shifted previous key
|
|
|
|
{ finalcut::fc::Fkey_sprint , 0 , "%f" }, // shifted print key
|
|
|
|
{ finalcut::fc::Fkey_sredo , 0 , "%g" }, // shifted redo key
|
|
|
|
{ finalcut::fc::Fkey_sreplace , 0 , "%h" }, // shifted replace key
|
|
|
|
{ finalcut::fc::Fkey_sright , CSI "1;2C" , "%i" }, // shifted right-arrow key
|
|
|
|
{ finalcut::fc::Fkey_srsume , 0 , "%j" }, // shifted resume key
|
|
|
|
{ finalcut::fc::Fkey_ssave , 0 , "!1" }, // shifted save key
|
|
|
|
{ finalcut::fc::Fkey_ssuspend , 0 , "!2" }, // shifted suspend key
|
|
|
|
{ finalcut::fc::Fkey_sundo , 0 , "!3" }, // shifted undo key
|
|
|
|
{ finalcut::fc::Fkey_f11 , CSI "23~" , "F1" }, // F11 function key
|
|
|
|
{ finalcut::fc::Fkey_f12 , CSI "24~" , "F2" }, // F12 function key
|
|
|
|
{ finalcut::fc::Fkey_f13 , ESC "O1;2P", "F3" }, // F13 function key
|
|
|
|
{ finalcut::fc::Fkey_f14 , ESC "O1;2Q", "F4" }, // F14 function key
|
|
|
|
{ finalcut::fc::Fkey_f15 , ESC "O1;2R", "F5" }, // F15 function key
|
|
|
|
{ finalcut::fc::Fkey_f16 , ESC "O1;2S", "F6" }, // F16 function key
|
|
|
|
{ finalcut::fc::Fkey_f17 , CSI "15;2~", "F7" }, // F17 function key
|
|
|
|
{ finalcut::fc::Fkey_f18 , CSI "17;2~", "F8" }, // F18 function key
|
|
|
|
{ finalcut::fc::Fkey_f19 , CSI "18;2~", "F9" }, // F19 function key
|
|
|
|
{ finalcut::fc::Fkey_f20 , CSI "19;2~", "FA" }, // F20 function key
|
|
|
|
{ finalcut::fc::Fkey_f21 , CSI "20;2~", "FB" }, // F21 function key
|
|
|
|
{ finalcut::fc::Fkey_f22 , CSI "21;2~", "FC" }, // F22 function key
|
|
|
|
{ finalcut::fc::Fkey_f23 , CSI "23;2~", "FD" }, // F23 function key
|
|
|
|
{ finalcut::fc::Fkey_f24 , CSI "24;2~", "FE" }, // F24 function key
|
|
|
|
{ finalcut::fc::Fkey_f25 , ESC "O1;5P", "FF" }, // F25 function key
|
|
|
|
{ finalcut::fc::Fkey_f26 , ESC "O1;5Q", "FG" }, // F26 function key
|
|
|
|
{ finalcut::fc::Fkey_f27 , ESC "O1;5R", "FH" }, // F27 function key
|
|
|
|
{ finalcut::fc::Fkey_f28 , ESC "O1;5S", "FI" }, // F28 function key
|
|
|
|
{ finalcut::fc::Fkey_f29 , CSI "15;5~", "FJ" }, // F29 function key
|
|
|
|
{ finalcut::fc::Fkey_f30 , CSI "17;5~", "FK" }, // F30 function key
|
|
|
|
{ finalcut::fc::Fkey_f31 , CSI "18;5~", "FL" }, // F31 function key
|
|
|
|
{ finalcut::fc::Fkey_f32 , CSI "19;5~", "FM" }, // F32 function key
|
|
|
|
{ finalcut::fc::Fkey_f33 , CSI "20;5~", "FN" }, // F33 function key
|
|
|
|
{ finalcut::fc::Fkey_f34 , CSI "21;5~", "FO" }, // F34 function key
|
|
|
|
{ finalcut::fc::Fkey_f35 , CSI "23;5~", "FP" }, // F35 function key
|
|
|
|
{ finalcut::fc::Fkey_f36 , CSI "24;5~", "FQ" }, // F36 function key
|
|
|
|
{ finalcut::fc::Fkey_f37 , ESC "O1;6P", "FR" }, // F37 function key
|
|
|
|
{ finalcut::fc::Fkey_f38 , ESC "O1;6Q", "FS" }, // F38 function key
|
|
|
|
{ finalcut::fc::Fkey_f39 , ESC "O1;6R", "FT" }, // F39 function key
|
|
|
|
{ finalcut::fc::Fkey_f40 , ESC "O1;6S", "FU" }, // F40 function key
|
|
|
|
{ finalcut::fc::Fkey_f41 , CSI "15;6~", "FV" }, // F41 function key
|
|
|
|
{ finalcut::fc::Fkey_f42 , CSI "17;6~", "FW" }, // F42 function key
|
|
|
|
{ finalcut::fc::Fkey_f43 , CSI "18;6~", "FX" }, // F43 function key
|
|
|
|
{ finalcut::fc::Fkey_f44 , CSI "19;6~", "FY" }, // F44 function key
|
|
|
|
{ finalcut::fc::Fkey_f45 , CSI "20;6~", "FZ" }, // F45 function key
|
|
|
|
{ finalcut::fc::Fkey_f46 , CSI "21;6~", "Fa" }, // F46 function key
|
|
|
|
{ finalcut::fc::Fkey_f47 , CSI "23;6~", "Fb" }, // F47 function key
|
|
|
|
{ finalcut::fc::Fkey_f48 , CSI "24;6~", "Fc" }, // F48 function key
|
|
|
|
{ finalcut::fc::Fkey_f49 , ESC "O1;3P", "Fd" }, // F49 function key
|
|
|
|
{ finalcut::fc::Fkey_f50 , ESC "O1;3Q", "Fe" }, // F50 function key
|
|
|
|
{ finalcut::fc::Fkey_f51 , ESC "O1;3R", "Ff" }, // F51 function key
|
|
|
|
{ finalcut::fc::Fkey_f52 , ESC "O1;3S", "Fg" }, // F52 function key
|
|
|
|
{ finalcut::fc::Fkey_f53 , CSI "15;3~", "Fh" }, // F53 function key
|
|
|
|
{ finalcut::fc::Fkey_f54 , CSI "17;3~", "Fi" }, // F54 function key
|
|
|
|
{ finalcut::fc::Fkey_f55 , CSI "18;3~", "Fj" }, // F55 function key
|
|
|
|
{ finalcut::fc::Fkey_f56 , CSI "19;3~", "Fk" }, // F56 function key
|
|
|
|
{ finalcut::fc::Fkey_f57 , CSI "20;3~", "Fl" }, // F57 function key
|
|
|
|
{ finalcut::fc::Fkey_f58 , CSI "21;3~", "Fm" }, // F58 function key
|
|
|
|
{ finalcut::fc::Fkey_f59 , CSI "23;3~", "Fn" }, // F59 function key
|
|
|
|
{ finalcut::fc::Fkey_f60 , CSI "24;3~", "Fo" }, // F60 function key
|
|
|
|
{ finalcut::fc::Fkey_f61 , ESC "O1;4P", "Fp" }, // F61 function key
|
|
|
|
{ finalcut::fc::Fkey_f62 , ESC "O1;4Q", "Fq" }, // F62 function key
|
|
|
|
{ finalcut::fc::Fkey_f63 , ESC "O1;4R", "Fr" }, // F63 function key
|
2020-04-29 00:37:29 +02:00
|
|
|
// vt100 key codes for arrow and function keys
|
|
|
|
{ finalcut::fc::Fkey_down , CSI "B" , "kdx"}, // down-arrow key (standard mode)
|
|
|
|
{ finalcut::fc::Fkey_down , ESC "OB" , "kdX"}, // down-arrow key (application mode)
|
|
|
|
{ finalcut::fc::Fkey_f1 , ESC "OP" , "k1X"}, // PF1 (application mode)
|
|
|
|
{ finalcut::fc::Fkey_f2 , CSI "OQ" , "k2X"}, // PF2 (application mode)
|
|
|
|
{ finalcut::fc::Fkey_f3 , ESC "OR" , "k3X"}, // PF3 (application mode)
|
|
|
|
{ finalcut::fc::Fkey_f4 , ESC "OS" , "k4X"}, // PF4 (application mode)
|
|
|
|
{ finalcut::fc::Fkey_left , CSI "D" , "klx"}, // left-arrow key (standard mode)
|
|
|
|
{ finalcut::fc::Fkey_left , ESC "OD" , "klX"}, // left-arrow key (application mode)
|
|
|
|
{ finalcut::fc::Fkey_right , CSI "C" , "krx"}, // right-arrow key (standard mode)
|
|
|
|
{ finalcut::fc::Fkey_right , ESC "OC" , "krX"}, // right-arrow key (application mode)
|
|
|
|
{ finalcut::fc::Fkey_up , CSI "A" , "kux"}, // up-arrow key (standard mode)
|
|
|
|
{ finalcut::fc::Fkey_up , ESC "OA" , "kuX"}, // up-arrow key (application mode)
|
|
|
|
// Fallback for rxvt with TERM=xterm
|
|
|
|
{ finalcut::fc::Fkey_home , CSI "7~" , "khx"}, // home key
|
|
|
|
{ finalcut::fc::Fkey_end , CSI "8~" , "@7x"}, // end key
|
|
|
|
{ finalcut::fc::Fkey_f1 , CSI "11~" , "k1x"}, // F1 function key
|
|
|
|
{ finalcut::fc::Fkey_f2 , CSI "12~" , "k2x"}, // F2 function key
|
|
|
|
{ finalcut::fc::Fkey_f3 , CSI "13~" , "k3x"}, // F3 function key
|
|
|
|
{ finalcut::fc::Fkey_f4 , CSI "14~" , "k4x"}, // F4 function key
|
|
|
|
// Fallback for TERM=ansi
|
|
|
|
{ finalcut::fc::Fkey_end , CSI "K" , "@7X"}, // end key
|
|
|
|
// Keypad keys
|
|
|
|
{ finalcut::fc::Fkey_enter , ESC "OM" , "@8x"}, // enter key
|
|
|
|
{ finalcut::fc::Fkey_slash , ESC "Oo" , "KP1"}, // keypad slash
|
|
|
|
{ finalcut::fc::Fkey_asterisk , ESC "Oj" , "KP2"}, // keypad asterisk
|
|
|
|
{ finalcut::fc::Fkey_minus_sign, ESC "Om" , "KP3"}, // keypad minus sign
|
|
|
|
{ finalcut::fc::Fkey_plus_sign , ESC "Ok" , "KP4"}, // keypad plus sign
|
2020-04-25 02:32:33 +02:00
|
|
|
{ 0 , 0 , "\0" }
|
2018-07-22 23:07:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FKeyboardTest
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
class FKeyboardTest : public CPPUNIT_NS::TestFixture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FKeyboardTest();
|
2018-07-23 02:23:10 +02:00
|
|
|
~FKeyboardTest();
|
2018-07-22 23:07:49 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void classNameTest();
|
|
|
|
void noArgumentTest();
|
2018-07-29 13:25:16 +02:00
|
|
|
void escapeKeyTest();
|
|
|
|
void characterwiseInputTest();
|
|
|
|
void severalKeysTest();
|
|
|
|
void functionKeyTest();
|
2018-07-29 23:49:11 +02:00
|
|
|
void metaKeyTest();
|
2018-07-29 13:25:16 +02:00
|
|
|
void sequencesTest();
|
|
|
|
void mouseTest();
|
|
|
|
void utf8Test();
|
|
|
|
void unknownKeyTest();
|
2018-07-22 23:07:49 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Adds code needed to register the test suite
|
|
|
|
CPPUNIT_TEST_SUITE (FKeyboardTest);
|
|
|
|
|
|
|
|
// Add a methods to the test suite
|
|
|
|
CPPUNIT_TEST (classNameTest);
|
|
|
|
CPPUNIT_TEST (noArgumentTest);
|
2018-07-29 13:25:16 +02:00
|
|
|
CPPUNIT_TEST (escapeKeyTest);
|
|
|
|
CPPUNIT_TEST (characterwiseInputTest);
|
|
|
|
CPPUNIT_TEST (severalKeysTest);
|
|
|
|
CPPUNIT_TEST (functionKeyTest);
|
2018-07-29 23:49:11 +02:00
|
|
|
CPPUNIT_TEST (metaKeyTest);
|
2018-07-29 13:25:16 +02:00
|
|
|
CPPUNIT_TEST (sequencesTest);
|
|
|
|
CPPUNIT_TEST (mouseTest);
|
|
|
|
CPPUNIT_TEST (utf8Test);
|
|
|
|
CPPUNIT_TEST (unknownKeyTest);
|
2018-07-22 23:07:49 +02:00
|
|
|
|
|
|
|
// End of test suite definition
|
|
|
|
CPPUNIT_TEST_SUITE_END();
|
2018-07-23 01:48:29 +02:00
|
|
|
void init();
|
2018-07-22 23:07:49 +02:00
|
|
|
void input (std::string);
|
|
|
|
void processInput();
|
|
|
|
void clear();
|
|
|
|
void keyPressed();
|
|
|
|
void keyReleased();
|
|
|
|
void escapeKeyPressed();
|
|
|
|
|
2019-09-04 23:57:31 +02:00
|
|
|
// Data members
|
2018-12-03 03:22:36 +01:00
|
|
|
FKey key_pressed{0};
|
|
|
|
FKey key_released{0};
|
|
|
|
int number_of_keys{0};
|
2018-12-10 01:48:26 +01:00
|
|
|
finalcut::FKeyboard* keyboard{nullptr};
|
2018-07-22 23:07:49 +02:00
|
|
|
};
|
|
|
|
|
2018-07-23 02:23:10 +02:00
|
|
|
//----------------------------------------------------------------------
|
2018-07-22 23:07:49 +02:00
|
|
|
FKeyboardTest::FKeyboardTest()
|
|
|
|
{
|
2018-07-23 01:48:29 +02:00
|
|
|
init();
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
2018-07-23 02:23:10 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
FKeyboardTest::~FKeyboardTest()
|
|
|
|
{
|
|
|
|
delete keyboard;
|
|
|
|
}
|
|
|
|
|
2018-07-22 23:07:49 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::classNameTest()
|
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FKeyboard k;
|
2019-10-05 23:20:07 +02:00
|
|
|
const finalcut::FString& classname = k.getClassName();
|
|
|
|
CPPUNIT_ASSERT ( classname == "FKeyboard" );
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::noArgumentTest()
|
|
|
|
{
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKey() == 0 );
|
2018-10-11 03:46:37 +02:00
|
|
|
finalcut::FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
|
|
|
std::size_t size = sizeof(buffer);
|
2018-07-22 23:07:49 +02:00
|
|
|
|
2018-10-11 03:46:37 +02:00
|
|
|
CPPUNIT_ASSERT ( size == finalcut::FKeyboard::FIFO_BUF_SIZE );
|
2018-07-22 23:07:49 +02:00
|
|
|
CPPUNIT_ASSERT ( buffer[0] == 0 );
|
|
|
|
int sum = 0;
|
|
|
|
|
2018-10-11 03:46:37 +02:00
|
|
|
for (std::size_t i = 0; i < size; i++)
|
2018-07-22 23:07:49 +02:00
|
|
|
sum += int(buffer[i]);
|
|
|
|
|
|
|
|
CPPUNIT_ASSERT ( sum == 0 );
|
|
|
|
|
|
|
|
timeval* time = keyboard->getKeyPressedTime();
|
|
|
|
CPPUNIT_ASSERT ( time->tv_sec == 0);
|
|
|
|
CPPUNIT_ASSERT ( time->tv_usec == 0);
|
|
|
|
|
|
|
|
CPPUNIT_ASSERT ( ! keyboard->isInputDataPending() );
|
|
|
|
CPPUNIT_ASSERT ( ! keyboard->unprocessedInput() );
|
|
|
|
CPPUNIT_ASSERT ( ! keyboard->isKeyPressed() );
|
|
|
|
|
|
|
|
keyboard->clearKeyBufferOnTimeout();
|
|
|
|
|
|
|
|
if ( keyboard->isKeyPressed() )
|
|
|
|
keyboard->fetchKeyCode();
|
|
|
|
|
|
|
|
// special case: Esc key
|
|
|
|
keyboard->escapeKeyHandling();
|
|
|
|
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKey() == 0 );
|
2020-03-05 21:30:54 +01:00
|
|
|
|
|
|
|
// Keypress timeout
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKeypressTimeout() == 100 * 1000 );
|
2020-03-07 21:32:18 +01:00
|
|
|
|
2020-03-05 21:30:54 +01:00
|
|
|
keyboard->setKeypressTimeout(0); // 0 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKeypressTimeout() == 0 );
|
|
|
|
|
|
|
|
keyboard->setKeypressTimeout(100000); // 100 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKeypressTimeout() == 100 * 1000 );
|
|
|
|
|
|
|
|
// Read blocking time
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 100 * 1000 );
|
2020-03-07 21:32:18 +01:00
|
|
|
|
2020-03-05 21:30:54 +01:00
|
|
|
keyboard->setReadBlockingTime(1000000); // 1000 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 1000 * 1000 );
|
|
|
|
|
|
|
|
keyboard->setReadBlockingTime(0); // 0 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 0 );
|
|
|
|
|
|
|
|
keyboard->setReadBlockingTime(50000); // 50 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 50 * 1000 );
|
|
|
|
|
|
|
|
keyboard->setReadBlockingTime(100000); // 100 ms
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 100 * 1000 );
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-07-29 13:25:16 +02:00
|
|
|
void FKeyboardTest::escapeKeyTest()
|
2018-07-22 23:07:49 +02:00
|
|
|
{
|
2018-07-27 12:16:43 +02:00
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// Mintty application escape key
|
2018-07-22 23:07:49 +02:00
|
|
|
input("\033O[");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_escape_mintty );
|
2018-07-22 23:07:49 +02:00
|
|
|
clear();
|
|
|
|
|
2018-07-27 12:16:43 +02:00
|
|
|
// Normal escape (needs a timeout)
|
2018-07-22 23:07:49 +02:00
|
|
|
input("\033");
|
|
|
|
processInput();
|
2018-10-03 22:23:55 +02:00
|
|
|
// Wait 100 ms (= 100,000,000 ns)
|
2019-09-28 03:13:06 +02:00
|
|
|
const struct timespec ms[]{{0, 100000000L}};
|
|
|
|
nanosleep (ms, NULL);
|
2018-07-22 23:07:49 +02:00
|
|
|
keyboard->escapeKeyHandling();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_escape );
|
2018-07-27 12:16:43 +02:00
|
|
|
keyboard->clearKeyBufferOnTimeout();
|
2018-07-22 23:07:49 +02:00
|
|
|
clear();
|
2018-07-29 13:25:16 +02:00
|
|
|
}
|
2018-07-22 23:07:49 +02:00
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::characterwiseInputTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
2018-07-22 23:07:49 +02:00
|
|
|
|
2018-07-27 12:16:43 +02:00
|
|
|
// Cursor down in character by character input (e.g. rxvt-cygwin-native)
|
|
|
|
input("\033");
|
|
|
|
processInput();
|
|
|
|
input("[");
|
|
|
|
processInput();
|
|
|
|
input("B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-07-29 13:25:16 +02:00
|
|
|
CPPUNIT_ASSERT ( number_of_keys == 1 );
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
2018-07-29 13:25:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::severalKeysTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
2018-07-27 12:16:43 +02:00
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
// Input of two 1 byte characters
|
|
|
|
input("A");
|
|
|
|
input("B");
|
2018-07-22 23:07:49 +02:00
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-07-29 13:25:16 +02:00
|
|
|
CPPUNIT_ASSERT ( number_of_keys == 2 );
|
|
|
|
CPPUNIT_ASSERT ( key_pressed == 'B' );
|
|
|
|
CPPUNIT_ASSERT ( key_released == 'B' );
|
2018-07-22 23:07:49 +02:00
|
|
|
clear();
|
2018-07-27 12:16:43 +02:00
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
// F1, F2, F3
|
|
|
|
input("\033[11~\033[12~\033[13~");
|
2018-07-27 12:16:43 +02:00
|
|
|
processInput();
|
2018-07-29 13:25:16 +02:00
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
|
|
|
CPPUNIT_ASSERT ( number_of_keys == 3 );
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 );
|
|
|
|
CPPUNIT_ASSERT ( key_released == finalcut::fc::Fkey_f3 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
2018-07-29 13:25:16 +02:00
|
|
|
}
|
2018-07-27 12:16:43 +02:00
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::functionKeyTest()
|
|
|
|
{
|
2018-07-27 12:16:43 +02:00
|
|
|
// Function key F1 (numeric keypad PF1)
|
2018-11-24 03:22:47 +01:00
|
|
|
input("\033OP");
|
2018-07-27 12:16:43 +02:00
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-11-24 03:22:47 +01:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f1 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F1
|
|
|
|
input("\033[11~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f1 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F2 (numeric keypad PF2)
|
|
|
|
input("\033OQ");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f2 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F2
|
|
|
|
input("\033[12~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f2 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
// Function key F3 (numeric keypad PF3)
|
2018-07-27 12:16:43 +02:00
|
|
|
input("\033OR");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F3
|
|
|
|
input("\033[13~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
// Function key F4 (numeric keypad PF3)
|
2018-07-27 12:16:43 +02:00
|
|
|
input("\033OS");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f4 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F4
|
|
|
|
input("\033[14~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f4 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F5
|
|
|
|
input("\033[15~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f5 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F6
|
|
|
|
input("\033[17~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f6 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F7
|
|
|
|
input("\033[18~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f7 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F8
|
|
|
|
input("\033[19~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f8 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F9
|
|
|
|
input("\033[20~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f9 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F10
|
|
|
|
input("\033[21~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f10 );
|
2018-07-27 12:16:43 +02:00
|
|
|
clear();
|
2018-07-29 13:25:16 +02:00
|
|
|
|
|
|
|
// Function key F11
|
|
|
|
input("\033[23~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f11 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F12
|
|
|
|
input("\033[24~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f12 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F13 (shift + F1)
|
|
|
|
input("\033O1;2P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f13 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F14 (shift + F2)
|
|
|
|
input("\033O1;2Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f14 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F15 (shift + F3)
|
|
|
|
input("\033O1;2R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f15 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F16 (shift + F4)
|
|
|
|
input("\033O1;2S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f16 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F17 (shift + F5)
|
|
|
|
input("\033[15;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f17 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F18 (shift + F6)
|
|
|
|
input("\033[17;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f18 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F19 (shift + F7)
|
|
|
|
input("\033[18;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f19 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F20 (shift + F8)
|
|
|
|
input("\033[19;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f20 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F21 (shift + F9)
|
|
|
|
input("\033[20;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f21 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F22 (shift + F10)
|
|
|
|
input("\033[21;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f22 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F23 (shift + F11)
|
|
|
|
input("\033[23;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f23 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F24 (shift + F12)
|
|
|
|
input("\033[24;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f24 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F25 (ctrl + F1)
|
|
|
|
input("\033O1;5P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f25 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F26 (ctrl + F2)
|
|
|
|
input("\033O1;5Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f26 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F27 (ctrl + F3)
|
|
|
|
input("\033O1;5R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f27 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F28 (ctrl + F4)
|
|
|
|
input("\033O1;5S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f28 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F29 (ctrl + F5)
|
|
|
|
input("\033[15;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f29 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F30 (ctrl + F6)
|
|
|
|
input("\033[17;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f30 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F31 (ctrl + F7)
|
|
|
|
input("\033[18;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f31 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F32 (ctrl + F8)
|
|
|
|
input("\033[19;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f32 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F33 (ctrl + F9)
|
|
|
|
input("\033[20;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f33 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F34 (ctrl + F10)
|
|
|
|
input("\033[21;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f34 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F35 (ctrl + F11)
|
|
|
|
input("\033[23;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f35 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F36 (ctrl + F12)
|
|
|
|
input("\033[24;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f36 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F37 (shift + ctrl + F1)
|
|
|
|
input("\033O1;6P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f37 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F38 (shift + ctrl + F2)
|
|
|
|
input("\033O1;6Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f38 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F39 (shift + ctrl + F3)
|
|
|
|
input("\033O1;6R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f39 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F40 (shift + ctrl + F4)
|
|
|
|
input("\033O1;6S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f40 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F41 (shift + ctrl + F5)
|
|
|
|
input("\033[15;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f41 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F42 (shift + ctrl + F6)
|
|
|
|
input("\033[17;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f42 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F43 (shift + ctrl + F7)
|
|
|
|
input("\033[18;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f43 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F44 (shift + ctrl + F8)
|
|
|
|
input("\033[19;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f44 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F45 (shift + ctrl + F9)
|
|
|
|
input("\033[20;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f45 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F46 (shift + ctrl + F10)
|
|
|
|
input("\033[21;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f46 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F47 (shift + ctrl + F11)
|
|
|
|
input("\033[23;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f47 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F48 (shift + ctrl + F12)
|
|
|
|
input("\033[24;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f48 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F49 (meta + F1)
|
|
|
|
input("\033O1;3P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f49 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F50 (meta + F2)
|
|
|
|
input("\033O1;3Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f50 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F51 (meta + F3)
|
|
|
|
input("\033O1;3R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f51 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F52 (meta + F4)
|
|
|
|
input("\033O1;3S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f52 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F53 (meta + F5)
|
|
|
|
input("\033[15;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f53 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F54 (meta + F6)
|
|
|
|
input("\033[17;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f54 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F55 (meta + F7)
|
|
|
|
input("\033[18;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f55 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F56 (meta + F8)
|
|
|
|
input("\033[19;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f56 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F57 (meta + F9)
|
|
|
|
input("\033[20;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f57 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F58 (meta + F10)
|
|
|
|
input("\033[21;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f58 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F59 (meta + F11)
|
|
|
|
input("\033[23;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f59 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F60 (meta + F12)
|
|
|
|
input("\033[24;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f60 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F61 (shift + meta + F1)
|
|
|
|
input("\033O1;4P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f61 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F62 (shift + meta + F2)
|
|
|
|
input("\033O1;4Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f62 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Function key F63 (shift + meta + F3)
|
|
|
|
input("\033O1;4R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f63 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2018-07-29 23:49:11 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::metaKeyTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// meta-insert
|
|
|
|
input("\033[2;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-insert
|
|
|
|
input("\033\033[2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-delete
|
|
|
|
input("\033[3;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-delete
|
|
|
|
input("\033\033[3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-home
|
|
|
|
input("\033[1;3H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_home );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-home
|
|
|
|
input("\033\033[1~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_home );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-end
|
|
|
|
input("\033[1;3F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_end );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-end
|
|
|
|
input("\033\033[4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_end );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-prev-page
|
|
|
|
input("\033[5;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-prev-page
|
|
|
|
input("\033\033[5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-next-page
|
|
|
|
input("\033[6;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_npage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-next-page
|
|
|
|
input("\033\033[6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_npage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f1
|
|
|
|
input("\033[1;3P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f1 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f1
|
|
|
|
input("\033\033[11~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f1 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f2
|
|
|
|
input("\033[1;3Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f2 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f2
|
|
|
|
input("\033\033[12~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f2 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f3
|
|
|
|
input("\033[1;3R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f3 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f3
|
|
|
|
input("\033\033[13~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f3 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f4
|
|
|
|
input("\033[1;3S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f4 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f4
|
|
|
|
input("\033\033[14~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f4 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f5
|
|
|
|
input("\033\033[15~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f5 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f6
|
|
|
|
input("\033\033[17~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f6 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f7
|
|
|
|
input("\033\033[18~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f7 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f8
|
|
|
|
input("\033\033[19~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f8 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f9
|
|
|
|
input("\033\033[20~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f9 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f10
|
|
|
|
input("\033\033[21~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f10 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f11
|
|
|
|
input("\033\033[23~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f11 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f12
|
|
|
|
input("\033\033[24~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f12 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-up
|
|
|
|
input("\033[1;3A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_up );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-up
|
|
|
|
input("\033\033[A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_up );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-down
|
|
|
|
input("\033[1;3B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_down );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-down
|
|
|
|
input("\033\033[B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_down );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-right
|
|
|
|
input("\033[1;3C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-right
|
|
|
|
input("\033\033[C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-left
|
|
|
|
input("\033[1;3D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-left
|
|
|
|
input("\033\033[D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-insert
|
|
|
|
input("\033[2;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-delete
|
|
|
|
input("\033[3;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sdc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-home
|
|
|
|
input("\033[1;4H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_shome );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-end
|
|
|
|
input("\033[1;4F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_send );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-prev-page
|
|
|
|
input("\033[5;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-next-page
|
|
|
|
input("\033[6;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_snpage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f1
|
|
|
|
input("\033[1;4P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf1 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f2
|
|
|
|
input("\033[1;4Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf2 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f3
|
|
|
|
input("\033[1;4R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf3 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f4
|
|
|
|
input("\033[1;4S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf4 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f5
|
|
|
|
input("\033[15;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf5 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f6
|
|
|
|
input("\033[17;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf6 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f7
|
|
|
|
input("\033[18;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf7 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f8
|
|
|
|
input("\033[19;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf8 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f9
|
|
|
|
input("\033[20;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf9 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f10
|
|
|
|
input("\033[21;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf10 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f11
|
|
|
|
input("\033[23;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf11 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-f12
|
|
|
|
input("\033[24;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf12 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-up
|
|
|
|
input("\033[1;4A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sup );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-down
|
|
|
|
input("\033[1;4B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sdown );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-right
|
|
|
|
input("\033[1;4C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sright );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-left
|
|
|
|
input("\033[1;4D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sleft );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-insert
|
|
|
|
input("\033[2;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_ic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-delete
|
|
|
|
input("\033[3;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_dc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-home
|
|
|
|
input("\033[1;5H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_home );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-end
|
|
|
|
input("\033[1;5F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_end );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-prev-page
|
|
|
|
input("\033[5;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_ppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-next-page
|
|
|
|
input("\033[6;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_npage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-up
|
|
|
|
input("\033[1;5A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_up );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-down
|
|
|
|
input("\033[1;5B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_down );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-right
|
|
|
|
input("\033[1;5C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_right );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-left
|
|
|
|
input("\033[1;5D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_left );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-insert
|
|
|
|
input("\033[2;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-delete
|
|
|
|
input("\033[3;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sdc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-home
|
|
|
|
input("\033[1;6H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_shome );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-end
|
|
|
|
input("\033[1;6F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_send );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-prev-page
|
|
|
|
input("\033[5;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-next-page
|
|
|
|
input("\033[6;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_snpage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-up
|
|
|
|
input("\033[1;6A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sup );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-down
|
|
|
|
input("\033[1;6B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sdown );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-right
|
|
|
|
input("\033[1;6C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sright );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-left
|
|
|
|
input("\033[1;6D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sleft );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-insert
|
|
|
|
input("\033[2;7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_ic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-delete
|
|
|
|
input("\033[3;7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_dc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-home
|
|
|
|
input("\033[1;7H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_home );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-end
|
|
|
|
input("\033[1;7F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_end );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-prev-page
|
|
|
|
input("\033[5;7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_ppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-next-page
|
|
|
|
input("\033[6;7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_npage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-up
|
|
|
|
input("\033[1;7A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_up );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-down
|
|
|
|
input("\033[1;7B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_down );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-right
|
|
|
|
input("\033[1;7C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_right );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-left
|
|
|
|
input("\033[1;7D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_left );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-insert
|
|
|
|
input("\033[2;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sic );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-delete
|
|
|
|
input("\033[3;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sdc );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-home
|
|
|
|
input("\033[1;8H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_shome );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-end
|
|
|
|
input("\033[1;8F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_send );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-prev-page
|
|
|
|
input("\033[5;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sppage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-next-page
|
|
|
|
input("\033[6;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_snpage );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f1
|
|
|
|
input("\033[1;8P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf1 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f2
|
|
|
|
input("\033[1;8Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf2 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f3
|
|
|
|
input("\033[1;8R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf3 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f4
|
|
|
|
input("\033[1;8S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf4 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f5
|
|
|
|
input("\033[15;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf5 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f6
|
|
|
|
input("\033[17;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf6 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f7
|
|
|
|
input("\033[18;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf7 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f8
|
|
|
|
input("\033[19;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf8 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f9
|
|
|
|
input("\033[20;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf9 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f10
|
|
|
|
input("\033[21;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf10 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f11
|
|
|
|
input("\033[23;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf11 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-f12
|
|
|
|
input("\033[24;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf12 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-up
|
|
|
|
input("\033[1;8A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sup );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-down
|
|
|
|
input("\033[1;8B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sdown );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-right
|
|
|
|
input("\033[1;8C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sright );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-left
|
|
|
|
input("\033[1;8D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sleft );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// menu
|
|
|
|
input("\033[29~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_menu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-menu
|
|
|
|
input("\033[29$");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-menu
|
|
|
|
input("\033[29;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-menu
|
|
|
|
input("\033[29^");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_menu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-menu
|
|
|
|
input("\033[29;5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_menu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-menu
|
|
|
|
input("\033[29@");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-menu
|
|
|
|
input("\033[29;6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-menu
|
|
|
|
input("\033[29;3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_menu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-meta-menu
|
|
|
|
input("\033[29;4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// ctrl-meta-menu
|
|
|
|
input("\033[29;7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_menu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shift-ctrl-meta-menu
|
|
|
|
input("\033[29;8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_smenu );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-tab
|
|
|
|
input("\033\t");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_tab );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-enter
|
|
|
|
input("\033\n");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_enter );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-enter
|
|
|
|
input("\033\r");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_enter );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-' '
|
|
|
|
input("\033 ");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_space );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-!
|
|
|
|
input("\033!");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_bang );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-"
|
|
|
|
input("\033\"");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_quotes );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-#
|
|
|
|
input("\033#");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_hash );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-$
|
|
|
|
input("\033$");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dollar );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-%
|
|
|
|
input("\033%");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_percent );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-&
|
|
|
|
input("\033&");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ampersand );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-'
|
|
|
|
input("\033'");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_apostrophe );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-(
|
|
|
|
input("\033(");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_parenthesis );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-)
|
|
|
|
input("\033)");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_parenthesis );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-*
|
|
|
|
input("\033*");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_asterisk );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-+
|
|
|
|
input("\033+");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_plus );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-,
|
|
|
|
input("\033,");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_comma );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-'-'
|
|
|
|
input("\033-");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_minus );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-.
|
|
|
|
input("\033.");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_full_stop );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-/
|
|
|
|
input("\033/");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_slash );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-0
|
|
|
|
input("\0330");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_0 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-1
|
|
|
|
input("\0331");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_1 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-2
|
|
|
|
input("\0332");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_2 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-3
|
|
|
|
input("\0333");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_3 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-4
|
|
|
|
input("\0334");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_4 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-5
|
|
|
|
input("\0335");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_5 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-6
|
|
|
|
input("\0336");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_6 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-7
|
|
|
|
input("\0337");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_7 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-8
|
|
|
|
input("\0338");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_8 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-9
|
|
|
|
input("\0339");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_9 );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-:
|
|
|
|
input("\033:");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_colon );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-;
|
|
|
|
input("\033;");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_semicolon );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-<
|
|
|
|
input("\033<");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_less_than );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-=
|
|
|
|
input("\033=");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_equals );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta->
|
|
|
|
input("\033>");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_greater_than );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-?
|
|
|
|
input("\033?");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_question_mark );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-@
|
|
|
|
input("\033@");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_at );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-A
|
|
|
|
input("\033A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_A );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-B
|
|
|
|
input("\033B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_B );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-C
|
|
|
|
input("\033C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_C );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-D
|
|
|
|
input("\033D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_D );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-E
|
|
|
|
input("\033E");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_E );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-F
|
|
|
|
input("\033F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_F );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-G
|
|
|
|
input("\033G");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_G );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-H
|
|
|
|
input("\033H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_H );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-I
|
|
|
|
input("\033I");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_I );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-J
|
|
|
|
input("\033J");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_J );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-K
|
|
|
|
input("\033K");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_K );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-L
|
|
|
|
input("\033L");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_L );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-M
|
|
|
|
input("\033M");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_M );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-N
|
|
|
|
input("\033N");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_N );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-O
|
|
|
|
input("\033O");
|
|
|
|
processInput();
|
2018-10-03 22:23:55 +02:00
|
|
|
// Wait 100 ms - Substring keys needs a timeout
|
2019-09-28 03:13:06 +02:00
|
|
|
const struct timespec ms[]{{0, 100000000L}};
|
|
|
|
nanosleep (ms, NULL);
|
2018-07-29 23:49:11 +02:00
|
|
|
keyboard->escapeKeyHandling();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_O );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-P
|
|
|
|
input("\033P");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_P );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-Q
|
|
|
|
input("\033Q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Q );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-R
|
|
|
|
input("\033R");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_R );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-S
|
|
|
|
input("\033S");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_S );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-T
|
|
|
|
input("\033T");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_T );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-U
|
|
|
|
input("\033U");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_U );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-V
|
|
|
|
input("\033V");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_V );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-W
|
|
|
|
input("\033W");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_W );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-X
|
|
|
|
input("\033X");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_X );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-Y
|
|
|
|
input("\033Y");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Y );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted meta-Z
|
|
|
|
input("\033Z");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Z );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-[
|
|
|
|
input("\033[");
|
|
|
|
processInput();
|
2018-10-03 22:23:55 +02:00
|
|
|
// Wait 100 ms - Substring keys needs a timeout
|
2019-09-28 03:13:06 +02:00
|
|
|
nanosleep (ms, NULL);
|
2018-07-29 23:49:11 +02:00
|
|
|
keyboard->escapeKeyHandling();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_square_bracket );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-'\'
|
|
|
|
input("\033\\");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_backslash );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-]
|
|
|
|
input("\033]");
|
|
|
|
processInput();
|
2018-10-03 22:23:55 +02:00
|
|
|
// Wait 100 ms - Substring keys needs a timeout
|
2019-09-28 03:13:06 +02:00
|
|
|
nanosleep (ms, NULL);
|
2018-07-29 23:49:11 +02:00
|
|
|
keyboard->escapeKeyHandling();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_square_bracket );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-^
|
|
|
|
input("\033^");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_caret );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-_
|
|
|
|
input("\033_");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_underscore );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-`
|
|
|
|
input("\033`");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_grave_accent );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-a
|
|
|
|
input("\033a");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_a );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-b
|
|
|
|
input("\033b");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_b );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-c
|
|
|
|
input("\033c");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_c );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-d
|
|
|
|
input("\033d");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_d );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-e
|
|
|
|
input("\033e");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_e );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-f
|
|
|
|
input("\033f");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-g
|
|
|
|
input("\033g");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_g );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-h
|
|
|
|
input("\033h");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_h );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-i
|
|
|
|
input("\033i");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_i );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-j
|
|
|
|
input("\033j");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_j );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-k
|
|
|
|
input("\033k");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_k );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-l
|
|
|
|
input("\033l");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_l );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-m
|
|
|
|
input("\033m");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_m );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-n
|
|
|
|
input("\033n");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_n );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-o
|
|
|
|
input("\033o");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_o );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-p
|
|
|
|
input("\033p");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_p );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-q
|
|
|
|
input("\033q");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_q );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-r
|
|
|
|
input("\033r");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_r );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-s
|
|
|
|
input("\033s");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_s );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-t
|
|
|
|
input("\033t");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_t );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-u
|
|
|
|
input("\033u");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_u );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-v
|
|
|
|
input("\033v");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_v );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-w
|
|
|
|
input("\033w");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_w );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-x
|
|
|
|
input("\033x");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_x );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-y
|
|
|
|
input("\033y");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_y );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-z
|
|
|
|
input("\033z");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_z );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-{
|
|
|
|
input("\033{");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_curly_bracket );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-|
|
|
|
|
input("\033|");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_vertical_bar );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-}
|
|
|
|
input("\033}");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_curly_bracket );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// meta-~
|
|
|
|
input("\033~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_tilde );
|
2018-07-29 23:49:11 +02:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2018-07-29 13:25:16 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::sequencesTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// Clear-tab
|
|
|
|
input("\033[3~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ctab );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor up key in applications mode
|
|
|
|
input("\033OA");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_up );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor up key in positioning mode
|
|
|
|
input("\033[A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_up );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor down key in applications mode
|
|
|
|
input("\033OB");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor down key in positioning mode
|
|
|
|
input("\033[B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor right key in applications mode
|
|
|
|
input("\033OC");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_right );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor right key in positioning mode
|
|
|
|
input("\033[C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_right );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor left key in applications mode
|
|
|
|
input("\033OD");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_left );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Cursor left key in applications mode
|
|
|
|
input("\033OD");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_left );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Home key in positioning mode
|
|
|
|
input("\033[7~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_home );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Home key in applications mode
|
|
|
|
input("\033OH");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_home );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// End key in positioning mode
|
|
|
|
input("\033[8~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// End key in applications mode
|
|
|
|
input("\033OF");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// End key (ANSI terminal)
|
|
|
|
input("\033[K");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Next-page key (Page down)
|
|
|
|
input("\033[6~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_npage );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Previous-page key (Page up)
|
|
|
|
input("\033[5~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ppage );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Insert key
|
|
|
|
input("\033[2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ic );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Scroll-forward key (shift + up-arrow)
|
|
|
|
input("\033[1;2B");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sf );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Scroll-backward key (shift + down-arrow)
|
|
|
|
input("\033[1;2A");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sr );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Center of keypad
|
|
|
|
input("\033[E");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_b2 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// back-tab key
|
|
|
|
input("\033[Z");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_btab );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// find key
|
|
|
|
input("\033[1~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_find );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// select key
|
|
|
|
input("\033[4~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_select );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted delete-character key
|
|
|
|
input("\033[3;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sdc );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
2020-02-05 08:57:13 +01:00
|
|
|
// shifted end key
|
2018-07-29 13:25:16 +02:00
|
|
|
input("\033[1;2F");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_send );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted home key
|
|
|
|
input("\033[1;2H");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_shome );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted insert-character key
|
|
|
|
input("\033[2;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sic );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted left-arrow key
|
|
|
|
input("\033[1;2D");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sleft );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted next key
|
|
|
|
input("\033[6;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_snext );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// shifted previous key
|
|
|
|
input("\033[5;2~");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sprevious );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
2020-02-05 08:57:13 +01:00
|
|
|
// shifted right-arrow key
|
2018-07-29 13:25:16 +02:00
|
|
|
input("\033[1;2C");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sright );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Keypad slash (numlock off)
|
|
|
|
input("\033Oo");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_slash );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Keypad asterisk (numlock off)
|
|
|
|
input("\033Oj");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_asterisk );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Keypad minus sign (numlock off)
|
|
|
|
input("\033Om");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_minus_sign );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Keypad plus sign (numlock off)
|
|
|
|
input("\033Ok");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_plus_sign );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::mouseTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// X11 mouse
|
|
|
|
input("\033[M Z2");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// SGR mouse
|
|
|
|
input("\033[<0;11;7M");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_extended_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// URXVT mouse
|
|
|
|
input("\033[32;11;7M");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl;
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_urxvt_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
|
|
|
|
// Without mouse support
|
|
|
|
keyboard->disableMouseSequences();
|
|
|
|
input("\033[M Z2");
|
|
|
|
processInput();
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
input("\033[<0;11;7M");
|
|
|
|
processInput();
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_extended_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
input("\033[32;11;7M");
|
|
|
|
processInput();
|
2018-09-20 23:59:01 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_urxvt_mouse );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::utf8Test()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// UTF-8 encoded character
|
|
|
|
|
|
|
|
// Linear B syllable (4 bytes)
|
|
|
|
input("\360\220\200\200");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - code: " << key_pressed << std::endl;
|
2018-07-29 23:49:11 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0x10000 );
|
2018-07-29 13:25:16 +02:00
|
|
|
|
|
|
|
// Euro sign (3 bytes)
|
|
|
|
input("\342\202\254");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - code: " << key_pressed << std::endl;
|
2018-07-29 23:49:11 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0x20ac );
|
2018-07-29 13:25:16 +02:00
|
|
|
|
|
|
|
// u with two Dots (2 bytes)
|
|
|
|
input("\303\274");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - code: " << key_pressed << std::endl;
|
2018-07-29 23:49:11 +02:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0x00fc );
|
|
|
|
|
|
|
|
// @ (1 bytes)
|
|
|
|
input("@");
|
|
|
|
processInput();
|
|
|
|
std::cout << " - code: " << key_pressed << std::endl;
|
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0x0040 );
|
|
|
|
|
|
|
|
// Invalid UTF-8
|
2018-11-21 20:07:08 +01:00
|
|
|
key_pressed = 0xffffffff;
|
2018-07-29 23:49:11 +02:00
|
|
|
input("\377");
|
|
|
|
processInput();
|
2018-11-21 20:07:08 +01:00
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0xffffffff );
|
2018-07-29 13:25:16 +02:00
|
|
|
|
|
|
|
// Without UTF-8 support
|
|
|
|
keyboard->disableUTF8();
|
|
|
|
input("\360\220\200\200");
|
|
|
|
processInput();
|
2018-10-22 01:26:24 +02:00
|
|
|
CPPUNIT_ASSERT ( key_released == 128 );
|
2018-07-29 13:25:16 +02:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::unknownKeyTest()
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
// Unknown key code
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKeyName(0xf8d0) == "" );
|
|
|
|
|
|
|
|
// Unknown input
|
|
|
|
input("\033[_.");
|
|
|
|
processInput();
|
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0 );
|
|
|
|
CPPUNIT_ASSERT ( keyboard->getKeyName(key_pressed) == "" );
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
2018-07-23 01:48:29 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::init()
|
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
keyboard = new finalcut::FKeyboard();
|
2019-10-05 23:20:07 +02:00
|
|
|
auto cmd1 = std::bind(&FKeyboardTest::keyPressed, this);
|
|
|
|
auto cmd2 = std::bind(&FKeyboardTest::keyReleased, this);
|
|
|
|
auto cmd3 = std::bind(&FKeyboardTest::escapeKeyPressed, this);
|
|
|
|
finalcut::FKeyboardCommand key_cmd1 (cmd1);
|
|
|
|
finalcut::FKeyboardCommand key_cmd2 (cmd2);
|
|
|
|
finalcut::FKeyboardCommand key_cmd3 (cmd3);
|
2018-07-23 01:48:29 +02:00
|
|
|
keyboard->setPressCommand (key_cmd1);
|
|
|
|
keyboard->setReleaseCommand (key_cmd2);
|
|
|
|
keyboard->setEscPressedCommand (key_cmd3);
|
|
|
|
keyboard->setKeypressTimeout (100000); // 100 ms
|
2018-07-27 12:16:43 +02:00
|
|
|
processInput();
|
|
|
|
CPPUNIT_ASSERT ( key_pressed == 0 );
|
2018-07-23 01:48:29 +02:00
|
|
|
keyboard->enableUTF8();
|
|
|
|
keyboard->enableMouseSequences();
|
2019-10-08 04:37:19 +02:00
|
|
|
keyboard->setTermcapMap (reinterpret_cast<finalcut::fc::FKeyMap*>(test::fkey));
|
2018-07-23 01:48:29 +02:00
|
|
|
}
|
|
|
|
|
2018-07-22 23:07:49 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::input (std::string s)
|
|
|
|
{
|
|
|
|
// Simulates keystrokes
|
|
|
|
|
|
|
|
const char EOT = 0x04; // End of Transmission
|
|
|
|
|
|
|
|
std::string::const_iterator iter;
|
|
|
|
iter = s.begin();
|
|
|
|
|
|
|
|
while ( iter != s.end() )
|
|
|
|
{
|
|
|
|
char c = *iter;
|
2018-07-23 01:48:29 +02:00
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
if ( ioctl (finalcut::FTermios::getStdIn(), TIOCSTI, &c) < 0 )
|
2018-07-23 01:48:29 +02:00
|
|
|
break;
|
|
|
|
|
2018-07-22 23:07:49 +02:00
|
|
|
++iter;
|
|
|
|
}
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
if ( ioctl (finalcut::FTermios::getStdIn(), TIOCSTI, &EOT) < 0 )
|
2018-07-23 01:48:29 +02:00
|
|
|
return;
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::processInput()
|
|
|
|
{
|
2020-03-05 21:30:54 +01:00
|
|
|
keyboard->escapeKeyHandling(); // special case: Esc key
|
2018-07-22 23:07:49 +02:00
|
|
|
keyboard->clearKeyBufferOnTimeout();
|
|
|
|
|
|
|
|
if ( keyboard->isKeyPressed() )
|
|
|
|
keyboard->fetchKeyCode();
|
2020-08-16 02:01:47 +02:00
|
|
|
|
|
|
|
// Keyboard interval timeout 75 ms (= 75,000,000 ns)
|
|
|
|
const struct timespec ms[]{{0, 75000000L}};
|
|
|
|
nanosleep (ms, NULL);
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::clear()
|
|
|
|
{
|
|
|
|
keyboard->clearKeyBuffer();
|
2018-07-29 13:25:16 +02:00
|
|
|
number_of_keys = \
|
|
|
|
key_pressed = \
|
|
|
|
key_released = 0;
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::keyPressed()
|
|
|
|
{
|
|
|
|
key_pressed = keyboard->getKey();
|
2018-07-29 13:25:16 +02:00
|
|
|
number_of_keys++;
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::keyReleased()
|
|
|
|
{
|
|
|
|
key_released = keyboard->getKey();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void FKeyboardTest::escapeKeyPressed()
|
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
key_pressed = finalcut::fc::Fkey_escape;
|
|
|
|
key_released = finalcut::fc::Fkey_escape;
|
2018-07-29 13:25:16 +02:00
|
|
|
number_of_keys++;
|
2018-07-22 23:07:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Put the test suite in the registry
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION (FKeyboardTest);
|
|
|
|
|
|
|
|
// The general unit test main part
|
|
|
|
#include <main-test.inc>
|