Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to walkInputElement Textareas (like [ and ] in w3m)? #60

Open
unhammer opened this issue Aug 5, 2011 · 1 comment
Open

how to walkInputElement Textareas (like [ and ] in w3m)? #60

unhammer opened this issue Aug 5, 2011 · 1 comment

Comments

@unhammer
Copy link

unhammer commented Aug 5, 2011

I would like to do this:

key.setViewKey("]", function () {
    command.walkInputElement(command.elementsRetrieverTextarea, true, true);
}, "Focus to the next textarea", false);

key.setViewKey("[", function () {
    command.walkInputElement(command.elementsRetrieverTextarea, false, true);
}, "Focus to the previous textarea", false);

(based on M-n/M-p, I want it to work like in w3m), but they seem to have no effect. What am I doing wrong?

@unhammer
Copy link
Author

The best I have until now is:

   key.setViewKey([["M-]"], ["M-["]], function (aEvent, aArg) {
       command.focusElement(command.elementsRetrieverTextarea, 0);
   }, "Focus to the first textarea", true);
   key.setCaretKey([["M-]"], ["M-["]], function (aEvent, aArg) {
       command.focusElement(command.elementsRetrieverTextarea, 0);
   }, "Focus to the first textarea", true);

   key.setEditKey("M-]", function (aEvent, aArg) {
       ext.exec("focus-to-the-next-text-area", aArg);
   }, "Focus to the next textarea", true);
   key.setEditKey("M-[", function (aEvent, aArg) {
       ext.exec("focus-to-the-previous-text-area", aArg);
   }, "Focus to the previous textarea", true);

which puts focus in the first textarea and then goes through them.
Unfortunately, it doesn't seem to cycle (I can't go from first
straight back to last).

A better workaround seems to be to just use HoK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant