Thursday, March 14, 2013

Hotkeys for Surusu

My biggest usability requirement for surusu is some decent hotkeys so I can do reps. The default accesskeys were designed for pre-smartphone cellphones, and are not ergonomic on a keyboard. My preferred layout is based around QWERTY right hand home row: K both shows the back of the card and scores it 3 (a reasonable default should you hit on accident or be unsure how to score) L and SEMICOLON score 4 and 5, and are used to push cards you know further off into the future. In the other direction, J scores a 1 when I forget a card. On the rare occasions when I barely miss, middle finger up to I scores a 2. I don't use 0.

Chrome:

UPDATED Oct 2014 for new 3-button layout (although if you look at surusu's code it seems insanely fragile and likely to break again next time the page changes). Install the Keyboard-fu add-on, go to its settings, Import/Export Hotkeys, and paste the following:



{"globalFilters":"[\"-https:#mail.google.com/*\",\"-https:#reader.google.com/*\",\"*\"]","hotkeys":"[[\"2\",\"k\",\"Show Back / Score 2/3\",\"if ($('#questionDiv').hasClass('repback')) {\\n  $('input[value=\\\"2 (>_<)...(~_~) 3\\\"]').click()\\n}  else {\\n  $('input[name=\\\"showanswer\\\"]').click()\\n}\\n\\n\\n\",[\"http://surusu.com/question.php\"]],[\"24\",\"l\",\"Score 4/5\",\"$('input[value=\\\"4 (^_^)...(^-^)/ 5\\\"]').click()\",[\"http://surusu.com/answer.php\"]],[\"25\",\";\",\"Score 4/5\",\"$('input[value=\\\"4 (^_^)...(^-^)/ 5\\\"]').click()\",[\"http://surusu.com/answer.php\"]],[\"27\",\"j\",\"Score 0/1\",\"$('input[value=\\\"0 (0_0)...(x_x) 1\\\"]').click()\",[\"http://surusu.com/answer.php\"]]]"}




Firefox:

Install “custom keyboard bindings” greasemonkey script (21947)

NOT UPDATED for single-page or new button layout. Edit the script and add this to the list of bindings:

"surusu.com":{
"question.php":{
  k:'//input[@name="showanswer"]'
},
"answer.php":{
  j:'//input[@accesskey="1"]',

i:'//input[@accesskey="2"]',
  k:'//input[@accesskey="3"]',
  l:'//input[@accesskey="4"]',
  SEMICOLON:'//input[@accesskey="5"]'
}
 },

No comments: