Page 1 of 1
[Poker 2] Change Right Control key to Media Eject OSX
Posted: 06 Nov 2014, 22:15
by moley
Does anyone know how I can change the Right Control key on a Poker 2 so that it will trigger the Eject Media key?
Thanks for any pointers...
Posted: 06 Nov 2014, 22:32
by Khers
Have you tried
Karabiner?
Posted: 06 Nov 2014, 22:43
by moley
Thank you...
I've installed it and had a look, but I can't work out how to make Control_R key behave as Eject
It's a mystery!
Posted: 06 Nov 2014, 22:46
by Muirium
Probably a good place to look. I can't see the option in System Preferences > Keyboard > Shortcuts at least. Although holding F12 works on keyboards without an eject key.
Posted: 06 Nov 2014, 22:47
by moley
Actually, perhaps it would be easier to say what I'd like to happen...
I'd like to set the ControlR key to shutoff the display
Shift+Option+Eject
Posted: 06 Nov 2014, 22:59
by Khers
I think you should be able to configure your own xml file in Karabiner to get that
Posted: 06 Nov 2014, 23:04
by moley
Khers wrote: ↑I think you should be able to configure your own xml file in Karabiner to get that
I'm a bit of a n00b when it comes to stuff like that.
If you can show me how, I'll be very grateful.
Posted: 06 Nov 2014, 23:10
by Khers
Not very skilled in this either I'm afraid. Managed to make my keyboard do what I wanted in the end though. Can give it a try tomorrow
Posted: 06 Nov 2014, 23:13
by moley
Khers wrote: ↑Not very skilled in this either I'm afraid. Managed to make my keyboard do what I wanted in the end though. Can give it a try tomorrow
Thank you!
Posted: 06 Nov 2014, 23:22
by Muirium
I've no experience with Karabiner (and I've no need to use it with my custom boards and controllers) but here's a tidbit that might make the task easier for you. The Command + Option + Eject = Sleep shortcut has been in OS X for donkeys years. (Try adding Control to the mix for some real fun!) But there's a key in the USB HID spec specifically to trigger system sleep. In fact, I think OS X accepts both of these:
Code: Select all
SYSTEM_POWER 0xA8 System Power
SYSTEM_SLEEP 0xA9 System Sleep
I use the System Power code in Soarer's Converter, so I have a power / sleep button on my Model M SSK etc. If Karabiner can send out any code you like, the macro might be irrelevant.
Posted: 06 Nov 2014, 23:28
by moley
I don't want to make the system sleep, just turn off the display. No screensaver, just a blank screen...
I hope there's a way to do it. Simply. So a simple fellow like me can do it.
Posted: 07 Nov 2014, 08:56
by Khers
moley wrote: ↑I don't want to make the system sleep, just turn off the display. No screensaver, just a blank screen...
I hope there's a way to do it. Simply. So a simple fellow like me can do it.
I don't have a right ctrl on the laptop I'm at atm
, so I instead changed right cmd plus option to have the behaviour I think you're after. Try putting this in your private.xml:
Code: Select all
<?xml version="1.0"?>
<root>
<item>
<name>R_CMD + R_Option for Eject</name>
<identifier>private.cmd_option_eject</identifier>
<autogen>__KeyToKey__ KeyCode::OPTION_R, ModifierFlag::COMMAND_R, KeyCode::VK_CONSUMERKEY_EJECT, ModifierFlag::OPTION_R | ModifierFlag::COMMAND_R </autogen>
</item>
</root>
Posted: 07 Nov 2014, 11:30
by moley
Thanks for this, we're getting somewhere….
I've had a play with Karabiner and sadly writing XML code is beyond me…
I'd like to have the Right Control key trigger Control + Shift + Eject
I've written the XML below, but it's not working. Can anyone tell me what I've done wrong?
Much appreciated.
Code: Select all
<?xml version="1.0"?>
<root>
<item>
<name>L_CNTL + L_Shift + Eject</name>
<identifier>private.cntrl_shift_eject</identifier>
<autogen>
__KeyToKey__
KeyCode:: ModifierFlag::CONTROL_R,
KeyCode:: ModifierFlag::CONTROL_L, ModifierFlag::SHIFT_L, KeyCode::VK_CONSUMERKEY_EJECT,
</autogen>
</item>
</root>
It comes up with the following error message:
Error in XML.
----------------------------------------
Unknown symbol:
KeyCode::ModifierFlag::CONTROL_R
----------------------------------------
Posted: 07 Nov 2014, 13:31
by Khers
I think you're just defining things in the wrong order. Try this instead:
Code: Select all
<root>
<item>
<name>R_Option for Display Sleep</name>
<identifier>private.option_display_sleep</identifier>
<autogen>__KeyToKey__ KeyCode::CONTROL_R, ModifierFlag::CONTROL_R, KeyCode::VK_CONSUMERKEY_EJECT, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L </autogen>
</item>
</root>
Looks a bit goofy, but the sleep command does not seem to take with ModifierFlag::NONE
Posted: 07 Nov 2014, 14:20
by moley
You absolute star!
Works a treat.
Thank you so much...
Posted: 07 Nov 2014, 16:26
by Khers
You're welcome! Glad it worked!