Example #1
0
 def test_parse_hotkey_example(self):
     alt_codes = hotkey.key_to_scan_codes('alt')
     shift_codes = hotkey.key_to_scan_codes('shift')
     a_codes = hotkey.key_to_scan_codes('a')
     b_codes = hotkey.key_to_scan_codes('b')
     c_codes = hotkey.key_to_scan_codes('c')
     self.assertEqual(hotkey.parse_hotkey("alt+shift+a, alt+b, c"), ((alt_codes, shift_codes, a_codes), (alt_codes, b_codes), (c_codes,)))
Example #2
0
 def test_parse_hotkey_list_names(self):
     self.assertEqual(hotkey.parse_hotkey(['a', 'b', 'c']), (((1,), (2,), (3,)),))
Example #3
0
 def test_parse_hotkey_deep_list_scan_codes(self):
     result = hotkey.parse_hotkey('a')
     self.assertEqual(hotkey.parse_hotkey(result), (((1,),),))
Example #4
0
 def test_parse_hotkey_list_scan_codes(self):
     self.assertEqual(hotkey.parse_hotkey([1, 2, 3]), (((1,), (2,), (3,)),))
Example #5
0
 def test_parse_hotkey_steps(self):
     self.assertEqual(hotkey.parse_hotkey('a+b, b+c'), (((1,), (2,)), ((2,), (3,))))
Example #6
0
 def test_parse_hotkey_simple_steps(self):
     self.assertEqual(hotkey.parse_hotkey('a,b'), (((1,),), ((2,),)))
     self.assertEqual(hotkey.parse_hotkey('a, b'), (((1,),), ((2,),)))
Example #7
0
 def test_parse_hotkey_keys(self):
     self.assertEqual(hotkey.parse_hotkey('left shift + a'), (((5,), (1,),),))
     self.assertEqual(hotkey.parse_hotkey('left shift+a'), (((5,), (1,),),))
Example #8
0
 def test_parse_hotkey_separators(self):
     self.assertEqual(hotkey.parse_hotkey('+'), hotkey.parse_hotkey('plus'))
     self.assertEqual(hotkey.parse_hotkey(','), hotkey.parse_hotkey('comma'))
Example #9
0
 def test_parse_hotkey_simple(self):
     self.assertEqual(hotkey.parse_hotkey('a'), (((1,),),))
     self.assertEqual(hotkey.parse_hotkey('A'), (((1, -1),),))