1717
1818# ----------------------------------------------------- CONSTANTS ------------------------------------------------------
1919
20+ DEFAULT_SIZE = 1
2021DEFAULT_COUNT = 20
2122DEFAULT_DELAY = 3.
2223DEFAULT_MINLEN = 2
@@ -35,7 +36,8 @@ def _parse_args():
3536 parser .add_argument ('--port' , type = str , default = SUPERKEY_DEFAULT_PORT , help = 'Serial port to connect to.' )
3637 parser .add_argument ('--baudrate' , type = int , default = SUPERKEY_DEFAULT_BAUDRATE , help = 'Serial port baud rate.' )
3738 parser .add_argument ('--timeout' , type = float , default = SUPERKEY_DEFAULT_TIMEOUT , help = 'Serial port timeout (s).' )
38- parser .add_argument ('--count' , type = int , default = DEFAULT_COUNT , help = 'Number of words to key.' )
39+ parser .add_argument ('--size' , type = int , default = DEFAULT_SIZE , help = 'Number of words to key per group.' )
40+ parser .add_argument ('--count' , type = int , default = DEFAULT_COUNT , help = 'Number of groups to key.' )
3941 parser .add_argument ('--delay' , type = float , default = DEFAULT_DELAY , help = 'Seconds to delay between each word.' )
4042 parser .add_argument ('--minlen' , type = int , default = DEFAULT_MINLEN , help = 'Minimum word length.' )
4143 parser .add_argument ('--maxlen' , type = int , default = DEFAULT_MAXLEN , help = 'Maximum word length.' )
@@ -47,6 +49,7 @@ def _parse_args():
4749def _main (port : str ,
4850 baudrate : int ,
4951 timeout : float ,
52+ size : int ,
5053 count : int ,
5154 delay : float ,
5255 minlen : int ,
@@ -80,12 +83,13 @@ def _main(port: str,
8083 for _ in range (count ):
8184
8285 # Get a random word and key it
83- word = wl .random (min_length = minlen , max_length = maxlen ).upper ()
84- intf .autokey (word , block = True )
86+ words = [wl .random (min_length = minlen , max_length = maxlen ).upper () for _ in range (size )]
87+ string = ' ' .join (words )
88+ intf .autokey (string , block = True )
8589
8690 # Print the word after a delay
8791 time .sleep (delay )
88- print (word )
92+ print (string )
8993 time .sleep (delay * .5 )
9094
9195 except KeyboardInterrupt :
@@ -113,6 +117,7 @@ def _main(port: str,
113117 _main (port = args .port ,
114118 baudrate = args .baudrate ,
115119 timeout = args .timeout ,
120+ size = args .size ,
116121 count = args .count ,
117122 delay = args .delay ,
118123 minlen = args .minlen ,
0 commit comments