Fedora Linux Support Community & Resources Center
Old 23rd August 2011, 07:39 PM
Bazu135's Avatar
Bazu135 Offline
Registered User
Join Date: Aug 2011
Location: Luton, UK
Age: 31
Posts: 291
Keyboard commands in wminput .config files

I've installed the packages required to use a wiimote as a remote control in Fedora, and am currently trying to write a config file to use the wiimote for Clementine.

My file currently looks like this:

# This is the wminput-clementine file
Wiimote.A = KEY_F6   #Play/Pause
Wiimote.B = KEY_F7   #Stop
Wiimote.Left = KEY_F5   #Skip back
Wiimote.Right = KEY_F8   #Skip forward
# Wiimote.Minus = KEY_XF86AudioLowerVolume   #Lower volume
# Wiimote.Plus = KEY_XF86AudioRaiseVolume   #Raise volume
# Wiimote.Home = KEY_XF86AudioMedia   #Launch Clementine
# Wiimote.2 = KEY_CTRL+Q   #Quit
The uncommented lines work successfully; however, the bottom four are causing me problems.

I have the following questions regarding this:

1) In Clementine, 'CTRL+Q' is used to quit the program - how would I map this to a button? (As the above throws an error)

2) The lines such as 'KEY_XF86AudioLowerVolume' refer to the hotkeys on my keyboard - I'm basically trying to assign those to the remote. I took those names from those given in Preferences/Keyboard Shortcuts, but they throw an error too ("syntax error, unexpected '\n', expecting BTN_ACTION"). How would I correct this?

3) I suspect it would be 'more correct' to map the home key to a 'launch Clementine' function, rather than to that specific hotkey function (as this would in future provide me with the means to launch any other program I wrote a config file for). How would I do this?

4) Not sure if this is actually possible or not, but... At present, the wiimote enters the commands in whichever window I have active (so if I press A while on the terminal, it enters F6 in the terminal). Is there a way to change this to what would effectively be "F6 in Clementine" instead? (So that I could be on another program and use the remote without having to switch back to the Clementine window)

Many thanks in advance!

---------- Several posts tidied up at 07:55 PM ---------- Previous post was at 07:39 PM ----------

Resolved the volume buttons:

# Wiimote.Minus = KEY_VOLUMEDOWN   #Lower volume
# Wiimote.Plus = KEY_VOLUMEUP   #Raise volume
Obvious when you know it

I've also managed to apply a part-fix to issue 1 in this post; by assigning KEY_LEFTCTRL to Wiimote.1 and KEY_Q to Wiimote.2, I can enter Ctrl+Q via the wiimote (1+2). Is there a means of apply 'Ctrl+Q' to one button, though?

Also, is there a way of assigning a terminal command (e.g. 'clementine' to launch Clementine, or 'killall clementine' to kill Clementine) to a wiimote button?

Last edited by Bazu135; 2nd December 2011 at 11:12 AM. Reason: Updated title
Reply With Quote
Old 25th August 2011, 08:36 PM
Bazu135's Avatar
Bazu135 Offline
Registered User
Join Date: Aug 2011
Location: Luton, UK
Age: 31
Posts: 291
Re: Keyboard commands in .config files

Update to all the above:

I've set custom keyboard commands to launch Clementine and to kill it, thus:

clementine = Ctrl+Shift+C
kill clementine = Ctrl+Shift+K
Wiimote.1 = KEY_LEFTCTRL
Wiimote.Up = KEY_C
Wiimote.Down = KEY_K
Now, launching Clementine is 1+2+Up, killing is 1+2+Down.

My same questions still stand, though:

- Can two or more buttons (e.g. Ctrl+Q) be assigned to a single Wiimote button?
- Can text commands (e.g. kill clementine) be assigned to a button?

The above fix does give me a solution, but it still feels inelegant/improper. Any suggestions would be welcome!
Reply With Quote
Old 2nd December 2011, 11:19 AM
Bazu135's Avatar
Bazu135 Offline
Registered User
Join Date: Aug 2011
Location: Luton, UK
Age: 31
Posts: 291
Re: Keyboard commands in .config files

Having revisited this topic recently, I've come to the following conclusions:

1) No, two buttons can't be assigned to one Wiimote button
2) No, text commands can't be assigned to a Wiimote button

I have, however, improved my .config file, as follows:
# This is the wminput-clementine file
Wiimote.A = KEY_PLAYPAUSE #Play/Pause
Wiimote.B = KEY_STOPCD #Stop
Wiimote.Up = KEY_MEDIA #Launch
Wiimote.Down = KEY_K #Kill 3/3
Wiimote.Left = KEY_PREVIOUSSONG #Skip back
Wiimote.Right = KEY_NEXTSONG #Skip forward
Wiimote.Plus = KEY_VOLUMEUP #Raise volume
Wiimote.Minus = KEY_VOLUMEDOWN #Lower volume
Wiimote.Home = KEY_V #Stop-after-song 3/3
Wiimote.1 = KEY_LEFTALT #Kill/Stop-after-song 1/3
Wiimote.2 = KEY_LEFTCTRL #Kill/Stop-after-song 2/3
1+2+Home actives 'Stop after this song' using Clementine's 'Ctrl+Alt+V' command.
1+2+Down kills Clementine using 'Ctrl+Alt+K' - a custom-defined keyboard command.

With the exception of 'Stop after this song', all the above commands work without Clementine needing to be the active window, which is a massive improvement on the previous version! 'Stop after this song' can be instructed by pressing Up first (i.e. to bring up the media player window).

For future reference for anyone who comes across this thread, a full list of the commands wminput can assign to the Wiimote can be found at this location: /usr/include/linux/input.h
Reply With Quote

commands, config, files, keyboard

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on red hat config commands redhat_ali Using Fedora 2 27th October 2007 07:16 AM
Commands and files in Gnome tauro_kpo Using Fedora 3 12th April 2007 06:09 AM
How to view hidden commands in text files steve54 Programming & Packaging 2 25th January 2006 02:45 PM
ps2 mouse and keyboard repeat commands richarc Hardware & Laptops 0 26th December 2004 06:55 PM

Current GMT-time: 11:43 (Monday, 25-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat