On Mon, Sep 19, 2011 at 11:52 PM, Andreas Tolf Tolfsen
<[email protected]> wrote:
> * Så talte Jarmo <[email protected]>:
>> Sorry for answering so late - so in the essence, what's the difference
>> between these two invocations: send_keys(["hello", :control, "i"])
>> send_keys("hello", [:control, "i"]) Does it mean that the first one presses
>> hello and "control + i" and then releases the keys and the second one
>> releases "hello" keys before sending "control + i"?
>
> As far as I understand this:
>
> Your first example, send_keys('hello', :control, 'i') will not press C-i at
> all.  It will type "hello", press Control, release Control, then type "i".
>
> The second example, send_keys('hello', [:control, 'i']) will type "hello", 
> hold
> down Control, press i, then release Control.

Because meta keys are "sticky", both will have the same effect. The
interesting thing is what happens to the next character typed. If the
array ends with the NULL key, then the next character will be normal
(which is what I'd expect), whereas in the first example the control
key is still held down. This design was picked to allow people to do
complex chording (as if driving emacs)

I note with a certain amount of surprise that I can't find a test that
expresses this. Bah! I guess that means that for now either behaviour
is correct :)

Simon
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to