History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-377
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Dan Fabulich
Reporter: Dan Fabulich
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

Add support for typeKeysNative

Created: 24/Oct/07 03:26 PM   Updated: 23/Nov/08 12:37 PM
Component/s: Server
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Relationship
 
This issue Relates to:
SRC-183 Add support for sending OS-level keys... Critical Resolved


 Description  « Hide
As of RC revision 2061, we support keyPressNative, so typeKeysNative shouldn't be too hard, should it?

Unfortunately, it's harder than it looks. Converting a string of characters into java.awt.event.KeyEvent codes is non-trivial.

http://java.sun.com/javase/6/docs/api/java/awt/event/KeyEvent.html

Converting the lower case letters A-Z is pretty straightforward... just get the ASCII value of the upper case version. So how do you type a capital X? You hold down shift (keyDown), type an X (keyPress) then release shift (keyUp).

OK, not too bad. Now, how about punctuation like a $? That'd be shift+VK_4, right? Well, sure, on US keyboards, but on some keyboards you'll find the currency sign ¤ there. http://en.wikipedia.org/wiki/Currency_(typography)

To convert even basic ASCII non-letters, you have to detect and support arbitrary keyboard layouts, including dead keys, etc.: http://en.wikipedia.org/wiki/Keyboard_layout (The quote symbol is notoriously finicky across layouts.)

And what about the rest of Unicode? Holding down the Hiragana function key? And on and on and on.

I think abbot has some code to support this: http://abbot.sourceforge.net though I haven't really looked, and anyway we can't use their code because it's CPL.

 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.