Active Topics

 


Reply
Thread Tools
Posts: 13 | Thanked: 8 times | Joined on Dec 2009
#1
When you hold a key to enter a symbol, why does it send the symbol first, then left, backspace, and right, instead of just sending backspace, then the symbol?

This does not work in the terminal unless the application supports command-line editing (like bash), which excludes anything that asks for a password.

For example, if you try to enter 'abc123' to this program:
Code:
import getpass

text = getpass.getpass('Test password:')
print 'you typed: %r' % text
it prints:
Code:
you typed: 'abcq1\x1b[\x1b[Cw2\x1b[\x1b[Ce3\x1b[\x1b[C'
I also noticed that if you have a fixed length field in the browser, you can't enter a symbol as the last character using this method.

Why would they implement it this way?
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:56.