in reply to W-M-F and event.keyCode===keys.ENTER

WWW::Mechanize::Firefox doesn't have any premade solution for this, but if you look at MozRepl::RemoteObject, each element gets the __event() method from there, which is a wrapper for sending JS events.

The code only provides for mouse events, so most likely you'll have to modify the Javascript to also generate keyboard events there.

Replies are listed 'Best First'.
Re^2: W-M-F and event.keyCode===keys.ENTER
by pghilb (Novice) on Jul 27, 2014 at 09:18 UTC

    Thank you very much indeed, Corion! Managed to solve the problem along the lines you've suggested.

    The situation is rather standard nowadays, with all these autofillers, etc. which makes the straight assigning of values impossible.

      Note that WWW::Mechanize::Firefox already sends focus and blur events if you use the ->field() method to set the value.

        Noted gratefully. I was trying to identify my input within a form, naturally, but it turned out to be difficult (the authors of the webpage seem to be a bit paranoid, anyway), that's why I was working on something else.

        Maybe a new method

        ...->set_nasty_value
        in W-M-F doing 'focus' and 'blur' on a node would be helpful on such occassions for the users of W-M-F.