FS#10763 - This patch speeds the keyboard input for scroll wheel devices
|
Details** This patch is for the Sansa Fuze but easily modified for other players with scroll wheels.
apps/keymaps/keymap-[your player].c needs to be modified ** This patch changes the keyboard input method for scroll wheel players to this: Scrolling the wheel forward selects the column of the desired character moving right. Reversing the wheel moves the keyboard cursor down (not left) to select the character. Reversing again inserts the letter and resets the row and column to the top left. Repeat...(right, down, right, down...) The benefit is not leaving the scroll wheel or stopping to click anything. The center select button is now always mapped to delete. Left and right always move the edit position. To make overshoot more forgiving reverse scrolling past the bottom of the keyboard moves the cursor to the top of the previous column. The posted patch includes keymap changes for the Sansa Fuze. These are the changes required for a different target: - { ACTION_KBD_UP, BUTTON_SCROLL_BACK, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_SCROLL_BACK, BUTTON_SCROLL_BACK, BUTTON_NONE }, + { ACTION_KBD_SCROLL_BACK, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_SCROLL_FWD, BUTTON_SCROLL_FWD, BUTTON_NONE }, + { ACTION_KBD_SCROLL_FWD, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE }, This patch will remove Morse code but preserves the unicode capability (not tested) |
As I said though, I hardly ever use the keyboard. I'm attaching a diff that simply adds the e200 keymap changes that are needed.
This is an update with a hanger on the cursor when switching columns.
I think it makes it a little easier to understand.
I added the iPod keymap if anyone wants to try that.
I took it out before realizing they can co-exist and it was a bit easier to navigate all the conditionals. If there's any interest in this for inclusion I would redo it with Morse still included. Have you tried it?
No, I just put that up as a proof of concept. I'm reworking it now so that it will peacefully co-exist with Morse mode (although I don't really know much about it.)
I don't have an iPod and I'm not sure what to map backspace to that won't interfere. I'm using scrollwheel for picking letters, left and right for cursor keys.
I changed the order of the character selection to down (scroll back) then right (scroll forward)
I still think this is a very fast method for input. Anyone using the database searches would appreciate it.
Anyone looking for the simple left/right scroll wheel patch should use the scroll_1d.v3.diff patch above.
Added scroll wheel events to the UI simulator to ease testing.
Scrolling selects the character to insert, moving horizontally and wrapping the ends; the left/right buttons move the cursor; select inserts; and menu deletes (backspace).
Added mousewheel events to uisimulator for this patch also.
Would you be opposed to posting a .gif of the scroll_1d in action? I unfortunately do not have time to make a test build right now, but your description sounds like the basic idea for the bare-bones update that a lot of people would like to see added. It basically just changes scroll movement to horizontal, and wraps, correct? That would be a huge improvement over current behavior, for sure.
Also, your rollin concept is also interesting, and I wonder what others may think of it. Have you gotten feedback on irc? I feel like some may say it's too drastic, but if scroll_1d works as I think it does, perhaps you can move in baby steps towards your ultimate concept. Good luck with it either way, if either of these get in I may actually *use* my ipod for text-related purposes.
Added click areas and mouse scroll wheel events to the UI simulator to facilitate testing. (iPod Video, Fuze, E200)
Attached a keyboard layout for iPod and Fuze and a narrow keyboard layout for the Sansa E200.
Resync
Now uses original virtual keyboard layout.
Now wraps on longest line for custom layouts.
Added click areas and mouse scroll wheel events to the UI simulator to facilitate testing. (iPod Video, Fuze, E200)
The process is to scroll just past the desired letter. Switching directions turns off acceleration so you can pick the right letter. Inserting, deleting, or edit cursor movements resets the acceleration to quickly seek to the next letter.
This should work on Fuze, iPod, and E200.
Create a dictionary file with one word per \n terminated line. Put the most common words at the top of the file. It does not need to be alphabetical. Save it as /.rockbox/pred_dict.txt MAX_DICT in keyboard.c reserves 85000 bytes for the dictionary file. Set it to something close to the actual dictionary size. The dictionary file is retained until reboot.
As text is entered the first match in the dictionary will be offered below the edit line. Press select to insert it.
1. your patch removes two (CONFIG_KEYPAD == PBELL_VIBE500_PAD) unnecessarily.
2. please try to keep at most 80 chars per line as per docs/CONTRIBUTING.
3. could you please separate dictionaly thing to another patch so that each patch contains one change?
4. i think undefining KBD_TOGGLE_INPUT in #ifdef HAVE_SCROLLWHEEL is wrong. they could be coexist if there are enough key.
5. imo, it is better to change page when cursor reaches top/bottom than left/right since cursor moves vertically fisrt and then horizontally, so it would be annoying to input a character on another page.
FS#11047committed first and then rewrite against that.FS#11047got committed, and it built just fine. I love it!Except that I found it a little counter-intuitive that when you started going along a row, it started one character to the right. So I fixed it.
Maybe you could add this feature to your rewrite?
Standard Sideways uses the wheel to move horizontally and left and right buttons to switch rows/edit mode.
Keep Rollin is the same except that it now includes Corwyn's modification.
Row-Column is for huge keyboard layouts. Use the wheel to switch characters within a row. Moving past the beginning or end of a row switches to row selection mode. Scroll to the desired row and press select to get back to horizontal mode.
The menu entry for selecting keyboard modes is Settings>General>System>Keyboard Mode
The Morse mode key now cycles through available modes.
Page flipping is now vertical for scroll wheel modes.
Menu is backspace on scroll wheel modes.
Predicted text is inserted by moving the cursor right at the end of the line. (This will be the last patch with predicted text. I wanted to test out different target & button combinations before i got rid of it.)
Scroll Wheel Targets: No line edit in Morse. Menu deletes, and left/right/wheel moves edit position.
iPod: Long Menu cycles modes, Play is save/quit, and Long Play is cancel
E200: Record cycles modes, Play is save/quit, and Menu is cancel
Fuze: Long Menu cycles modes
First about the keys, if I sum up correctly for iPods:
Menu short/long is Delete/Mode
Play short/long is Ok/Cancel
In Keep-Rollin, Scroll 1D, Row-Col and Morse, Prev/Next is Left/Right
You wrote "I don't have an iPod and I'm not sure what to map backspace to that won't interfere." (http://www.rockbox.org/tracker/task/10763#comment33394), short Menu is great.
Standard and Sideways:
I'm glad to have Sideways, it better fits my quite horizontal key map. Thanks.
Keep Rollin':
I'd suggest that while choosing the line (only the thin line is displayed), pushing the Select button writes nothing (it currently prints the first char of the line). I guess that's why you suggested a blank first column. Mmmh there must be another issue...
Scroll 1D:
Works as expected but I personally don't like it.
Row-Col
Good idea but the behavior was unexpected: you roll for the line, Select button to choose it, then roll for the column, Select button to choose it. Nice but I thought I'd go back to "line mode" mode directly (it took me several seconds to understand I had to go out of my key map to go back to "line mode").
The idea for Keep Rollin' is to not use the select at all, just roll back and forth. (Scrolling back after forward inserts the character and resets to home position.) I was thinking about using select to back up in case of scrolling too far. I really had trouble with this on my iPod Video until I reduced the touch wheel sensitivity in firmware/target/arm/ipod/button-clickwheel.c.
For Row-Col the idea was to group things together on lines. Suppose you had multiple alphabets and used a small font you could put each alphabet on a separate line so that mostly you stay within the line and just go vertical when you need to change sets.
Current features:
- Settings menu option for keyboard mode: Standard, Sideways, Keep Rollin, Scroll 1D, Row-Column, and Morse
- Keyboard mode cycling by holding menu key.
- Settings menu option for wheel speed on iPod video and those that use the same driver. This makes the v-keyboard more forgiving.
- Predictive text entry with word learning and prioritized words. Words entered via the keyboard will be added to the dictionary and given the highest priority. Create a dictionary file ".rockbox/pred_dict.txt" composed of one word per line with the most frequent words at the top of the file. A list of most common English words are available at http://www.duboislc.org/EducationWatch/First100Words.html. The define for MAX_DICT_SIZE should be set to pred_dict.txt size plus some extra for learned words. You must have at least an empty dictionary file for the learning to work.
Learning stops if the dictionary is full.
Modes:
-Sideways mode is just like standard except the the wheel moves left/right and the left/right buttons move the picker up/down.
-Keep Rollin uses a sequence of left scroll and right scroll to select the row and then the column of the letter, respectively. Left scrolling again inserts the letter and resets the position to home to start picking the row for the next letter. This makes entering text a continuous left-right scrolling action. Without having to use buttons. The most common glyphs should be at the top left of the layout for the best performance. This is my favorite mode on the Fuze. It works out to about 40 characters/minute.
-Scroll 1D uses the wheel to move the picker left/right and wraps to the next row at the ends.
-Row-Column mode is like Scroll 1D but if the picker gets to the end of a row it switches to row selection. The wheel is then used to move the row selector up or down. Selecting the row goes back to horizontal mode. This mode is good if you have many glyphs that can be grouped together by lines. This is what I use on the iPod Video because the lack of a real wheel with discreet notches makes Keep Rollin difficult.
Keep Rollin, Scroll 1D, Row-Column, and Morse mode use the left/right buttons to move the edit position. Pressing the right button at the end of the input line inserts the predicted text. (In Standard and Sideways scrolling right in edit mode at the end of the line does this.) Menu key deletes. Long Menu cycles modes.
Are you able to split out the Learning Dictionary/Predictive Text insert to seperate patch?
That would be awesome.
[St.]
If it wouldn't be too much hassle for you, I would appreciate it. I'm sure you know your code a lot better than I do ;)
It would be nice if each seperate entry mode was a different patch, and the learning dictionary a different patch also, then people could pick and choose exactly what they wanted, or just install your "combo-patch" if they want it all.
I personally think the the learning dictionary/Predictive text entry would have a good chance of getting committed if it were a separate patch.
Just a suggestion.
[St.]
The button mapping on the iPod is changed because the stock build doesn't seem to have a backspace.
Play - accept & exit
Long Play - abort
Menu - backspace