I want to send some modem AT commands using python code, and am wondering what is the keycode for the key combination control+z
Gath
Key code? If you send AT commands you are probably sending strings with ascii text and control codes, right? Ctrl-Z is usually 26 (decimal). So chr(26) should work, or if it's a part of a string, '\x1a' as 26 decimal is 1A hex.
That said, Ctrl-Z is not usually a part of the AT command set... so if this doesn't help you, maybe you could explain more what you are trying to do and why you would need to send Ctrl-Z.
I was using python3; none of these work for my problem and what I did was,
command_variable = chr(26)
ser.write(command_variable.encode('utf-8'))
this worked for me. you can concatenate it with any command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With