Rockbox

Tasklist

FS#10127 - Sansa e200v2: wrapping in menus

Attached to Project: Rockbox
Opened by Dustin Skoracki (sko) - Sunday, 12 April 2009, 09:00 GMT
Last edited by Thomas Martitz (kugel.) - Monday, 13 April 2009, 14:09 GMT
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Operating System Sansa e200
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch makes menus wrap if last/first item is reached. I compared the scrollwheel functions of the fuze and the e200v2 and took the handling of the repeat and wheel_delta variables from the fuze driver and implemented it to the e200v2 driver. I don't know if all these changes are necessary (i'm no C programmer), but it works fine.
This task depends upon

Closed by  Thomas Martitz (kugel.)
Monday, 13 April 2009, 14:09 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed in r20700. Good job and thanks!
Comment by Thomas Martitz (kugel.) - Sunday, 12 April 2009, 17:48 GMT
Good Work. I'm wondering if the code can be more cleaned up and be made like the fuze's driver.

PS: We need your full real name if you want this to be committed.
Comment by Dustin Skoracki (sko) - Sunday, 12 April 2009, 18:17 GMT
Well, I tried to use the whole scrollwheel() function of the fuze driver, but it is not as good as this one on the e200v2. With the function of the fuze driver it is possible that the next menu item is not selected if the wheel is turned very slow, with the one in the e200v2 driver (and your patch  FS#10120 ) its perfect I think: one physical click scrolls one item.
Comment by Thomas Martitz (kugel.) - Sunday, 12 April 2009, 18:19 GMT
Well, the fuze needs to skip 4 queue_posts while the e200 needs only 2 (see "++count >= 4 &&...." vs "else if (++wheel_click_count < 2)" which is why it skipped items for you. Try changing to ++count >= 2 if you insert the fuze's one.
Comment by Thomas Martitz (kugel.) - Monday, 13 April 2009, 10:30 GMT
Ok, I committed  FS#10120 .

Do you have found a way to make it not always wrap, but only if you reach the end/beginning slowly?
Comment by Dustin Skoracki (sko) - Monday, 13 April 2009, 11:12 GMT
Is it wrapping on fuze only if it's slow? I wonder if this is driver-related. The menu should only wrap if there is no BUTTON_REPEAT, so can it be related to the keymap?
Anyway, I made it more like the fuze driver... maybe in a different way than you expected: the wheel is working perfectly with the fuze's scrollwheel function if the skip count is 2 instead of 4, so I put the scrollwheel function out of the driver files into a extra file, so both are using the same code (was just an idea to avoid redundancies in the code) .
Comment by Thomas Martitz (kugel.) - Monday, 13 April 2009, 11:15 GMT
Right. On the Fuze it only wraps if you turn the wheel slowly (which means there's no BUTTON_REPEAT). And it should work like that on the e200 too (if possible).

Edit: Combining both drivers entirely would also be reasonable. The scrollwheel function is the only real difference.
Comment by Dustin Skoracki (sko) - Monday, 13 April 2009, 13:04 GMT
Ok, thanks to kugel here is a patch which wraps only if the wheel is turned slowly. The scrollwheel function is back in the driver file because of the changes. If someone wants to commit: my real name is Dustin Skoracki.

Loading...