RTM keyconfig

By kuy Last update Nov 12, 2008 — Installed 402 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 3 posts, 3 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
traycerb Scriptwright

This is great. It allowed me to create a shortcut that moves to the list of my choice (in the tasks view). To make it work, drop the given code into the script in an appropriate place (just like all the other shortcut keys are), and change the variable targetTab to the index number of the tab you want. See the script for details. If you add this to previous shortcut entries, add a comma to the end of the previous entry if not already there. If other keys are configured after this one, add a comma to the end of this one (after the bracket).

I've tested it out on my machine with FF 2.0.0.17 (have not upgraded to FF3 yet) and it works, but that's no guarantee for anyone else. My programming knowledge includes no javascript at all, so if anyone wants to clean it up, optimize it, feel free. It's pretty kludgy in that it doesn't go directly to the tab; it moves in a loop right or left until it reaches the target, but it's still pretty quick getting through my ~20 tabs. If anyone knows a more direct way, please post it.

[EDIT: userscripts truncates the code as it's apparently too long. I posted the code here:
http://traycerb.wordpress.com/remember-the-milk....
If you find any bugs, please post here.]

 
madbadger User

Very cool! Here's an example where I set the j/k keys to select one item as it moves up and down.

var cfg = {
    keys: [
        ["j", function(){
            var list = view.getViewList();
            if(list.keyboardPosition + 1 != list.entries.length){
                list.keyboardDown();
		taskList.taskSelectNone();
		list.keyboardSelect();
            }
        }],
        ["k", function(){
            var list = view.getViewList();
            if(list.keyboardPosition != 0){
                list.keyboardUp();
		taskList.taskSelectNone();
		list.keyboardSelect();
            }
        }]
    ],
    interval: 250
}

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel