Closed TanGentleman closed 5 months ago
Working on a patch that seems promising. I've added a method process_caps_lock() to KeystrokeList.
# Get keystrokes by simulating a string
gen = Generate()
gen.disable()
keys = gen.simulate_string('hippopotamus') # Type KeystrokeList
# Test process_caps_lock
# Replace first letter with caps lock
keys[0] = Keystroke('Key.caps_lock', None)
keys.process_caps_lock()
assert keys.to_string() == 'IPPOPOTAMUS'
keys.process_caps_lock()
assert keys.to_string() == 'ippopotamus'
# Replace the "u" with caps lock
keys[-2] = Keystroke('Key.caps_lock', 0.2222)
keys.process_caps_lock()
assert keys.to_string() == 'IPPOPOTAMs'
# Works as expected!
I'm going to add this as a step step when logging the KeystrokeList in classes/converter.
When collecting user input, caps lock seems to work, but I've intentionally disabled it when it comes to representing the string in KeystrokeList objects. Is this a bug?
To replicate: