Rockbox Technical Forums

Support and General Use => User Interface and Voice => Topic started by: GGGGGG on November 30, 2010, 02:46:27 PM

Title: Remap buttons?
Post by: GGGGGG on November 30, 2010, 02:46:27 PM
Is there any easy way to do this?

The reason I'm asking is because my old Sansa e280's scroll wheel broke, so now I can only select songs in the OF anymore, because Rockbox uses the wheel for everything. I left the player alone for a long time and got myself a Fuze instead, but recently I thought I might be able to remap the buttons so that I can select files in Rockbox by using the Play and the Menu key as up and down keys respectively, and in the WPS, use them as VolumeUp and VolumeDown. (Yeah, I know some other keys would have to be remapped as well, but I'm still thinking of the best way to do that.) I wouldn't need the keys in any other section though, as I'd only still use the e280 to listen to music.

So, is it possible, and if so, what do I need to do? Or is there perhaps a custom build that already has the keys mapped in a way similar to this?
Title: Re: Remap buttons?
Post by: saratoga on November 30, 2010, 03:04:44 PM
Grab the source and edit apps/keymaps/keymap-e200.c, then compile a modified build.

The BUTTON_SCROLL_FWD and BUTTON_SCROLL_BACK instances will probably be need to changed to BUTTON_UP, BUTTON_DOWN, etc.  Though I expect you'll need to experiment to figure out combinations that work well for different screens.
Title: Re: Remap buttons?
Post by: GGGGGG on November 30, 2010, 03:50:42 PM
Alright, thank you very much, but how would I go to 'compile' a build?
Title: Re: Remap buttons?
Post by: saratoga on November 30, 2010, 03:57:17 PM
http://www.rockbox.org/wiki/DevelopmentGuide
Title: Re: Remap buttons?
Post by: GGGGGG on December 01, 2010, 03:48:07 AM
Great! Thanks! :D
Title: Re: Remap buttons?
Post by: Carson Dyle on December 10, 2010, 10:17:34 PM
Is it possible to do simpler mappings without modifying code?

For instance, my Sansa Fuze has no dedicated volume button, so volume adjustment is only accessible on the WPS or in settings.  I'd like a simple, sure fire way to quickly get to the WPS so that I can quickly adjust the volume.

What would be ideal would be to have the 'Home' button always pull up the main menu no matter where you are (never unmapped), except that when in the main menu I'd like to have it pull up the WPS.  That way the WPS is never more than two button presses away.  Is that doable?
Title: Re: Remap buttons?
Post by: saratoga on December 10, 2010, 10:20:12 PM
Aside from the hotkey option, you have to edit code to change buttons.
Title: Re: Remap buttons?
Post by: [Saint] on December 10, 2010, 10:51:35 PM
Carson Dyle,

You could assign Volume Up and Volume Down to either Left/Right or Up/Down quickscreen slots.

That way, you have a way to quickly access the volume from almost anywhere.



[St.]
Title: Re: Remap buttons?
Post by: emreka on February 26, 2011, 06:00:16 PM
I'm having the exact same problem with my Sansa e280v2, and I must admit I cannot pull the "edit source/compile" option. But I still want to keep using my Sansa, I treat it terribly but it's solid like a rock and never failed me for over 3 years, I broke a philips in less than a week just recently.

Carson Dyle,

You could assign Volume Up and Volume Down to either Left/Right or Up/Down quickscreen slots.

That way, you have a way to quickly access the volume from almost anywhere.


[St.]

Can I assume that you could assign hotkeys offline? If so, how would I do it? Could I make it a combination of two buttons? It would save me a great deal of trouble.

Overlord Nadrian, if I may ask, did you go ahead and compile a custom build? If you did, would you be so kind to share it with me?
Title: Re: Remap buttons?
Post by: [Saint] on February 26, 2011, 06:46:50 PM
I'm not sure you're fully understanding my post...

You could assign Volume Up and Volume Down to either Left/Right or Up/Down quickscreen slots.

That way, you have a way to quickly access the volume from almost anywhere.

You don't have to compile a new build at all to achieve this, the manual will tell you all you need to know about the quickscreen (http://download.rockbox.org/daily/manual/rockbox-sansae200v2/rockbox-buildch5.html#x8-1030005.13) and assigning objects to it.



[St.]
Title: Re: Remap buttons?
Post by: emreka on February 26, 2011, 07:28:00 PM
My bad, I totally forgot about quickscreen and wasn't paying attention to the question you were referring to in your previous post. The quick screen suggestion doesnt apply to me anyway, as I am stuck without a scroll wheel to to perform any tasks on player. Even if I was able to assign volume controls to the quickscreen, it wouldn't be much of a help. What I need is to assign the functions of the wheel to two other buttons or button combinations, which seems beyond my skills. Thanks for the help anyway.

edit: I'm actually experimenting with the keymap-e200.c, thanks to "The Simple Guide To Compiling In Linux" it's quite easy to compile a build. What I'm trying to do is kill record function and replace "BUTTON_SCROLL_FWD&BACK" with "BUTTON_REC|BUTTON_DOWN&UP".
My question is, how would I kill all other functions of the Record button? Replacing it with the broken button in the keymap-e200.c doesn't seem to work. What else do I need to do?
Thanks in advance.
Title: Re: Remap buttons?
Post by: emreka on March 02, 2011, 01:37:49 PM
Sorry for stealing the thread,Overlord Nadrian. I will try to keep this as short as possible.
OK, I now realize "replacing all" was a stupid idea. I'm looking into the keymap and trying to solve conflicts, it doesn't seem so hard. I gave up some functions such as quickscreen, pitchscreen, scanning through songs, etc. I sorted out some tasks assigned to two buttons like "BUTTON_SELECT" and "BUTTON_RIGHT".  Releasing BUTTON_RIGHT&LEFT from default mapping, I assigned them to ACTION_WPS_VOLUP&DOWN in the WPS like this: BUTTON_RIGHT|BUTTON_REPEAT (which was formerly assign to scanning through songs) so now I can adjust the volume. The player is operational, with the ##Music# being on top and "Power button+right&left" combo, I can open files and switch through albums(folders). However I would like to access the database. Main problem is I can't browse "up & down" in any of the list views. I am stuck on the top. I can't see an option in the keymap either. Where am I doing wrong? What action code or option defines up&down in list views and main menu? Is it independent of the mappings? If you guys take the time to answer please keep in mind that I am not a power user or a native English speaker. Thanks.
Title: Re: Remap buttons?
Post by: posfan12 on April 16, 2011, 04:04:18 PM
Would it be possible to remap the power-on button? Unfortunately the little switch inside the unit broke and I don't have a replacement. (Maybe Frys has one? It is *tiny*!!)
Title: Re: Remap buttons?
Post by: saratoga on April 16, 2011, 04:09:21 PM
Would it be possible to remap the power-on button? Unfortunately the little switch inside the unit broke and I don't have a replacement. (Maybe Frys has one? It is *tiny*!!)

You could remap it inside rockbox, but you'd still need to use it for anything else other then rockbox (like turning on the player).
Title: Re: Remap buttons?
Post by: emreka on April 16, 2011, 04:27:11 PM
posfan12, if the power button is broken i think the only way to turn on the player is to connect it to PC. If you turn off auto-shut down you may not even need it. As for remapping buttons, it's not that hard. I'm attaching the original keymap for e200 (open it with any text editor other than notepad, it makes a mess), you might want to take a look, I can share a few tips if you decide to compile your own build.

That being said, I'd like to repeat my question. I pretty much sorted out everything except up and down function in any of the menus(my scroll wheel is broken). Are there action codes for that? I looked through the keymap but cannot find anything useful for me. What I want to do is replace the default tasks assigned UP and DOWN buttons and with those of scroll wheel.
Title: Re: Remap buttons?
Post by: posfan12 on April 16, 2011, 07:59:11 PM
I'm a little hesitant to install Rockbox at all, since if the unit freezes or gets bricked the only way to reset the unit is by pressing and holding down the power button.
Title: Re: Remap buttons?
Post by: Carson Dyle on April 18, 2011, 09:31:13 PM
Has anyone ever suggested placing button mappings in some type of editable text file that is loaded either at startup or from within Settings? Sure would be a lot easier than editing and recompiling source code.
Title: Re: Remap buttons?
Post by: saratoga on April 18, 2011, 10:18:24 PM
Has anyone ever suggested placing button mappings in some type of editable text file that is loaded either at startup or from within Settings? Sure would be a lot easier than editing and recompiling source code.

Yes, about a million times. 
Title: Re: Remap buttons?
Post by: Carson Dyle on April 19, 2011, 05:21:01 AM
Yes, about a million times. 

Figures.
Title: Re: Remap buttons?
Post by: LeoTheLion89 on January 09, 2012, 01:42:32 PM
i have a Philips GoGear HDD1830 RockBox by default has made my Playlist button the pause button the play button and pause button are the same thing on this model i want to remap it so the play/pause button actually pauses the player as i use this in my car and the pause button being the playlist button makes it hard to use also what does Car Adaptor Mode do?
Title: Re: Remap buttons?
Post by: saratoga on January 09, 2012, 01:52:14 PM
Is there a question in there?
Title: Re: Remap buttons?
Post by: LeoTheLion89 on January 09, 2012, 02:25:00 PM
yes i just asked it

Post Merge: January 09, 2012, 04:49:49 PM
yes i just asked it

i want to know how to remap the buttons and i want to know what Car Adaptor Mode does
Title: Re: Remap buttons?
Post by: saratoga on January 09, 2012, 06:37:11 PM
i want to know how to remap the buttons and i want to know what Car Adaptor Mode does

There are instructions in this thread for remapping buttons.  Car adapter mode stops playback when AC power is removed so that the player will start/stop with a car's ignition. 
Title: Re: Remap buttons?
Post by: LeoTheLion89 on January 10, 2012, 12:59:10 PM
i want to know how to remap the buttons and i want to know what Car Adaptor Mode does

There are instructions in this thread for remapping buttons.  Car adapter mode stops playback when AC power is removed so that the player will start/stop with a car's ignition. 

whats Morse Code Input for?
Title: Re: Remap buttons?
Post by: AlexP on March 10, 2012, 07:17:53 AM
Using morse code to input information in place of the on screen keyboard.
Title: Re: Remap buttons?
Post by: redblade8 on April 04, 2012, 09:31:22 PM
I'm happy with my key mapping right now...but for people that want to change it, what about an app or something that key maps like how Rockboy does? Press up key, down key...etc?