FS#12405 - Improve touchpad implementation for the fuzeplus's port

Attached to Project: Rockbox
Opened by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 00:32 GMT
Last edited by Dominik Riebeling (bluebrother) - Wednesday, 22 February 2012, 22:51 GMT
Task Type Patches
Category Battery/Charging
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.9
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Could someone checks that I did no blasphemy and commit it?
This task depends upon

Closed by  Dominik Riebeling (bluebrother)
Wednesday, 22 February 2012, 22:51 GMT
Reason for closing:  Out of Date
Additional comments about closing:  closed on request, see comments.
Comment by amaury pouly (pamaury) - Friday, 25 November 2011, 11:33 GMT
I don't understand what this patch does. The current behaviour is that Volume up/down increases/decreases the sensibility by 1. This patch adds a float which is not necessary since only integers are used and I don't understand the purpose of sensibiblity_counter: the more you increase it, the more you add each time ? Then pressing volume down will still increase it until it finally decreases it ?
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 12:44 GMT
Yeah I know I alos noticed yesteday that it was useless to have a float here... So Here is a better patch. Basicly it just set a variable that get increased or decreased unstead of sensitivity.value then increase or decrease it every 15 time. This way the setting change (up or down) slowly and its more easy to set a precise value.
Anyway is there any way I could change the title of this patch? I've had a closer look a the code and its not as difficult as I though. So I guess I could go on and map the gesture. something like : "improving touchpad's support for fuze+" would be convenient or should I just open a new patch?
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 15:25 GMT
this patch also change back and play/pause button border. The whole corner select them now.
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 15:26 GMT
so the file...
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 15:32 GMT
default value where wrong on the last patch. Now it should be ok - Pamaury do you confirm that you mixed the to devices default values? should I revert them?
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 25 November 2011, 18:25 GMT
So moving further:
1) added missing basic mapping for keyboard and comfirm screen. Regarding keyboard it is still very simple because we don't have enough control key for the moment:
- direction to choose a letter
- playpause to select the letter
- select (cross) to confirm text entry
- volume down to backspace
- power to abord

2) in WPS added support for Lock (back key)
Comment by amaury pouly (pamaury) - Saturday, 26 November 2011, 12:00 GMT
I checked the OF code and no the condition is not reversed so I think I will just change the default value to 13 or so for everyone since it's a reasonable compromise for now. Any objection ?
For the lock, I'm not sure back is a good idea and given your patch it would mean that any press on back would lock, not only holding it for 1 sec ?

I have another idea but I'm not sure everyone would like it: the touchpad has two "empty slots" at the bottom left and bottom right with no symbols. Why not have a special combination like pressing both at the same time ? Furthermore we would use those two empty slots as normal keys because two extra keys are really necessary in some screens/plugins ?
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Saturday, 26 November 2011, 12:14 GMT
Yeah actually I'm already on some thing like that:
I've implemented a new two_finger_select button that could be used for the lock (i think the point about two button gesture would be to have them handle general even that we whant. I find your idea also interesting - and I know how to do it so i will make a patch with that also... I personnaly think that at this point there are just no good solution because we have to test thing to look for the more usable think... So let's try and will see...
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Saturday, 26 November 2011, 23:13 GMT
So new patch:
1) Change the key limits on the touchpad: they are now 9 virtuals keys on 3 x 3 grid and a tenth key has been added: simultaneous touching the touchpad with 2 fingers (see patch 3 and 4 in the file.
A consequence I noticed is an very impressive increase of the touchpad reactivity because button zone are now wider.
2) Add A LOT LOT LOT of mapped key (see first patched file):
major change are:
a) in WPS:
-bottomright and bottomleft keys are direct link to file browser and playlist. another click and you are back in the WPS! (COMMENT: IS THERE A WAY TO GO TO THE DATABASE UNSTEAD?
-long press with two fingers activate LOCK when the finger are released from touchpad (this is the only way I found to avoid to much sensibility leadind to multiple lock unlock sequence)
b) keyboard:
We now have a fully fonctionnal virtual keyboard
-directions to select a letter
-play to insert a letter
-buttomright and bottomleft to move cursor
-back as backspace
-doublefinger key to finish
-power to abord
c) menu and list:
-left and right to go to previous/new page
-doublefinger key bring you back to the main menu

d) mapping for future : basic to handle recording, time and radio

3) reset standart sensitivity value to 13 on all touchpad

- a setting menu to have sensitivity and future scrolling sensitivity (I don't know how to do that, HELPS)
- Implement different kind of scrolling and test them
- having a menu to map button to everyone suits...
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Sunday, 27 November 2011, 00:12 GMT
name of a button variable changed to BUTTON_TWO_FINGERS
non compiling user can find a build here...
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Sunday, 27 November 2011, 00:44 GMT
correct a bug: lock didn't work!
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Sunday, 27 November 2011, 00:45 GMT
oups file!
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Sunday, 27 November 2011, 01:31 GMT
Well ok this time everything is ok and get rechecks this keymap file is a hell to fix!
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 28 November 2011, 08:37 GMT
I'm rewriting the whole keymaps file:
-have cleaner file especially by using recursivity by context calling
-mapping special setting menu (graphic equalizer for example)
-improving keys map consistency/usability (any suggestion will be taken in account)
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 28 November 2011, 08:38 GMT
for the moment I stuck because I need extra context/action and I have to find a way to implement them
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Tuesday, 29 November 2011, 22:25 GMT
Ok so I finally did a completed remap:
1) We have now a FULL and CONSISTENT mapping:
- I find a way to have volume in list
- I removed the menu link from the simple double finger click because it was too instable
- I activated bookmarkscreen and hotkeys (you can map one key yourself from the option menu)
- All usb fonction I could map ara also available and so on...

2) I made a little hack to have a more reliable double finger long click (lock) (I'm not sure if it is really efficient actually but we'll test that...anyway pamaury has idea about gesture too)

3) I remapped the simulator (two finger keys is 0) to have the new keys.

What I still need to know from user:
- I followed consistency and we loosed quite a lot of keys. To keep the possibility to have hotkey in list I had to use the only remaining slot which may seems unaturel: long press on back key activate hotkeys when in a list (database, tree, menu...). Is it going to be a problem for navigating (for what I briefly test it shouldn't but tell me otherwise...). A nice alterrnative woulde be to have the hotkey on long press playpause, but this is not consistent (this is meant to be playpause) so I'll be asking on the devlist to know how to do it the right way.
- I followed systematic consistency: we have now up and down keys as volume in wps \o/ Well this may seems a little stupid as we already have volume keys. Anyway I will ask on the mailling list if this is mandatory. If not It would be nice to know what could be mapped unstead? We already have a hotkey in WPS (bottomleft) and all possible link so I guess the best we could do would be to spread the fonctions already there to have something less compact.

- please also report any strange stuff not working.
- It was enough pain to map those keys so I not going to go all the way again to describe them. Hier is a link to the new keymaps files, which syntax is rather clear even for beginner:
( "|" means "and" button_rel means "release")
Comment by amaury pouly (pamaury) - Tuesday, 29 November 2011, 23:12 GMT
The patch seems ok to me except one little thing: why did you set BUTTON_BOTTOMLEFT to 0x00000208 ? This means that pressing bottom left is like pressing button back (0x200) and left (0x8) at the same time ! Button defines are meant to define a bit field so each button should be exactly one bit: 1,2,4,8,16,32,64,128,256,... So it should be:
#define BUTTON_BOTTOMLEFT 0x00000400
#define BUTTON_BOTTOMRIGHT 0x00000800
#define BUTTON_TWO_FINGERS 0x00001000
Tell me if I'm missing the point of these defines otherwise. Also great job for the keymaps !
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Tuesday, 29 November 2011, 23:57 GMT
LOL :D I didn't knew that! Why are there button like 10 = (1010)2 ?, ... Actually i didn't understood that and just set value hoping it will not mess the stuff, it didn't mess it because we cannot press several touch on the device anyway. I mapped gesture! :D For consistency I didn't want to have just random value which is the reason why I tooked those...
Comment by amaury pouly (pamaury) - Wednesday, 30 November 2011, 09:07 GMT
They are written in hexadecimal: 0x10=16, hexadecimal is a common way of writing things.
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Wednesday, 30 November 2011, 13:26 GMT
Slight modification to improve usuability:
- on the touchpad center touch is too sensible to have it as select key in keyboard mode -> move it back to playpause, only long press as action done remains
-I find the double finger touch too difficult to do without having error, so I let it for those who like it and add single press on power as alternative lock key. (anyway i noticed something funny:
if you lock with power you have to unlock with power and the same if you lock with two finger).
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Wednesday, 30 November 2011, 13:40 GMT
Non compiling user can have a zip here. Anyway this is ready to goes in the tree now.
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 19 December 2011, 22:56 GMT
I've made a patch to improve usuability:
- I find the double finger button too unstable to be usuable so I desactivated it in the keymap
- direct link from wps to recorder is useless (it can be accessed from menu anyway) and unpractical (it can be selected by error on leaving wps and so stop music)
- upon the very same reason I also desactivated the hotkey in tree.
- I restored the cancel button on single touch in both wps and tree
This could be discussed and eventualy taken to the tree (if so I will then go further and probably reverse the whole double finger implementation
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 26 December 2011, 17:42 GMT
definitive version that take all the two-finger button out
Comment by amaury pouly (pamaury) - Monday, 26 December 2011, 17:47 GMT
I committed the last patch, thanks!
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 30 December 2011, 01:49 GMT
So I've made a new cleanup before it get in the manual
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 30 December 2011, 01:50 GMT
and it also correct a typo in action.h
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Friday, 30 December 2011, 20:46 GMT
woaw! now this should be ok and this is actualized with the manual files I have on my local.
- a few stuff corrected
- define added to match the removing of radio and recording from firmware/export that is needed for manual
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Saturday, 31 December 2011, 18:42 GMT
- going into some correction/implementation into plugins. (text_viewer)
- correcting/implementing missing stuff (keyboard morse)
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Saturday, 31 December 2011, 21:29 GMT
-more cleanup and simplication
-correction on the time setting
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 02 January 2012, 19:45 GMT
this new little patch solve the volume up acting sometime like power (especially in game)
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Monday, 02 January 2012, 20:59 GMT
add failback comment
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Tuesday, 03 January 2012, 01:41 GMT
aside from the last patch as I'm now on the fuze+ manual for plugins, I started to correct all plugins keymaps this patch is not finish, just to be sure I don't lose it - or if ever someone want to helps...
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Wednesday, 04 January 2012, 01:48 GMT
Holy crap! I did it! All the game plugins are noow fully usuable!!!
Comment by Jean-Louis Biasini (JeanLouisBiasini) - Saturday, 11 February 2012, 13:13 GMT
we might want to close this now... Further work on gestures should go on a cleaner line and into git...
The actual touchpad implementation can now be considered as stable with all keymaps having being set and tested for all fonction and plugins
the last patch was commited on 7f26a10