Hi all,
I would need to emulate keystrokes, but not the standard keys. For example the Play/Pause button of my multimedia keyboard.
How can I send {Media_Play_Pause} in EventGhost? Because there is no option for the media buttons in Add action -> window -> Emulate keystrokes.
Thanks.
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
[HELP] How to emulate the Media buttons of my keyboard?
[HELP] How to emulate the Media buttons of my keyboard?
Last edited by Pirk on Thu Jun 17, 2010 12:51 pm, edited 1 time in total.
Re: [HELP] How to emulate the Media Play/Pause keyboard button?
Nobody can answer?
In AutoHotkey a simple script can do that: send {Media_Play_Pause}
But what is the equivalent in EventGhost? Maybe something in Python language?
In AutoHotkey a simple script can do that: send {Media_Play_Pause}
But what is the equivalent in EventGhost? Maybe something in Python language?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: [HELP] How to emulate the Media buttons of my keyboard?
For EventGhost is also very easy:All special keys, which can be used, you can find in file ...\EventGhost\eg\WinApi\SendKeys.py
Pako
Pako
Re: [HELP] How to emulate the Media buttons of my keyboard?
Here is the full list from EventGhost\eg\WinApi\SendKeys.py
You only need the leftmost value, so for example: {BrowserBack}, {MediaPlayPause}, {shift+e} and so on..
Leave the "Use alternate method to emulate keystrokes" checkbox unchecked when using the media keys.
*EDIT* drats, Pako was faster while I was still editing the post.
-jinxdone
You only need the leftmost value, so for example: {BrowserBack}, {MediaPlayPause}, {shift+e} and so on..
Leave the "Use alternate method to emulate keystrokes" checkbox unchecked when using the media keys.
*EDIT* drats, Pako was faster while I was still editing the post.
Code: Select all
VK_CODES = (
('AltGr', 10),
('Shift', 16),
('LShift', 160),
('RShift', 161),
('Ctrl', 17),
('LCtrl', 162),
('RCtrl', 163),
('Alt', 18),
('LAlt', 164),
('RAlt', 165),
('LWin', 91),
('RWin', 92),
('Apps', 93),
('LButton', 1),
('RButton', 2),
('MButton', 4),
('XButton1', 5),
('XButton2', 6),
('CapsLock', 20),
('NumLock', 144),
('ScrollLock', 145),
('Cancel', 3),
('Backspace', 8),
('Tabulator', 9),
('Clear', 12),
('Pause', 19),
('Kana', 21),
('Junja', 23),
('Final', 24),
('Hanja', 25),
('Escape', 27),
('Convert', 28),
('NonConvert', 29),
('Accept', 30),
('ModeChange', 31),
('Space', 32),
('PageUp', 33),
('PageDown', 34),
('End', 35),
('Home', 36),
('Left', 37),
('Up', 38),
('Right', 39),
('Down', 40),
('Select', 41),
('Print', 42),
('Execute', 43),
('PrintScreen', 44),
('Insert', 45),
('Delete', 46),
('Help', 47),
('A', 65),
('B', 66),
('C', 67),
('D', 68),
('E', 69),
('F', 70),
('G', 71),
('H', 72),
('I', 73),
('J', 74),
('K', 75),
('L', 76),
('M', 77),
('N', 78),
('O', 79),
('P', 80),
('Q', 81),
('R', 82),
('S', 83),
('T', 84),
('U', 85),
('V', 86),
('W', 87),
('X', 88),
('Y', 89),
('Z', 90),
('Sleep', 95),
('0', 48),
('1', 49),
('2', 50),
('3', 51),
('4', 52),
('5', 53),
('6', 54),
('7', 55),
('8', 56),
('9', 57),
('Numpad0', 96),
('Numpad1', 97),
('Numpad2', 98),
('Numpad3', 99),
('Numpad4', 100),
('Numpad5', 101),
('Numpad6', 102),
('Numpad7', 103),
('Numpad8', 104),
('Numpad9', 105),
('Multiply', 106),
('Add', 107),
('Separator', 108),
('Subtract', 109),
('Decimal', 110),
('Divide', 111),
('F1', 112),
('F2', 113),
('F3', 114),
('F4', 115),
('F5', 116),
('F6', 117),
('F7', 118),
('F8', 119),
('F9', 120),
('F10', 121),
('F11', 122),
('F12', 123),
('F13', 124),
('F14', 125),
('F15', 126),
('F16', 127),
('F17', 128),
('F18', 129),
('F19', 130),
('F20', 131),
('F21', 132),
('F22', 133),
('F23', 134),
('F24', 135),
('BrowserBack', 166),
('BrowserForward', 167),
('BrowserRefresh', 168),
('BrowserStop', 169),
('BrowserSearch', 170),
('BrowserFavorites', 171),
('BrowserHome', 172),
('VolumeMute', 173),
('VolumeDown', 174),
('VolumeUp', 175),
('MediaNextTrack', 176),
('MediaPrevTrack', 177),
('MediaStop', 178),
('MediaPlayPause', 179),
('LaunchMail', 180),
('LaunchMediaSelect', 181),
('LaunchApp1', 182),
('LaunchApp2', 183),
('OemPlus', 187),
('OemComma', 188),
('OemMinus', 189),
('OemPeriod', 190),
('Oem1', 186),
('Oem2', 191),
('Oem3', 192),
('Oem4', 219),
('Oem5', 220),
('Oem6', 221),
('Oem7', 222),
('Oem8', 223),
('Oem92', 146),
('Oem93', 147),
('Oem94', 148),
('Oem95', 149),
('Oem96', 150),
('OemE1', 225),
('Oem102', 226),
('OemE3', 227),
('OemE4', 228),
('ProcessKey', 229),
('OemE6', 230),
('Packet', 231),
('OemE9', 233),
('OemEA', 234),
('OemEB', 235),
('OemEC', 236),
('OemED', 237),
('OemEE', 238),
('OemEF', 239),
('OemF0', 240),
('OemF1', 241),
('OemF2', 242),
('OemF3', 243),
('OemF4', 244),
('OemF5', 245),
('Attn', 246),
('CrSel', 247),
('ExSel', 248),
('EraseEof', 249),
('Play', 250),
('Zoom', 251),
('Noname', 252),
('PA1', 253),
('OemClear', 254),
('U00', 0),
('U07', 7),
#('Reserved_0A', 10), we use this code as AltGr
('U0B', 11),
('U0E', 14),
('U0F', 15),
('U16', 22),
('U1A', 26),
('U3A', 58),
('U3B', 59),
('U3C', 60),
('U3D', 61),
('U3E', 62),
('U3F', 63),
('U40', 64),
('U5E', 94),
('U88', 136),
('U89', 137),
('U8A', 138),
('U8B', 139),
('U8C', 140),
('U8D', 141),
('U8E', 142),
('U8F', 143),
('U97', 151),
('U98', 152),
('U99', 153),
('U9A', 154),
('U9B', 155),
('U9C', 156),
('U9D', 157),
('U9E', 158),
('U9F', 159),
('UB8', 184),
('UB9', 185),
('UC1', 193),
('UC2', 194),
('UC3', 195),
('UC4', 196),
('UC5', 197),
('UC6', 198),
('UC7', 199),
('UC8', 200),
('UC9', 201),
('UCA', 202),
('UCB', 203),
('UCC', 204),
('UCD', 205),
('UCE', 206),
('UCF', 207),
('UD0', 208),
('UD1', 209),
('UD2', 210),
('UD3', 211),
('UD4', 212),
('UD5', 213),
('UD6', 214),
('UD7', 215),
('UD8', 216),
('UD9', 217),
('UDA', 218),
('UE0', 224),
('UE8', 232),
('UFF', 255),
('Return', 13),
)
VK_KEYS = {
'BACK': 0x08,
'TAB': 0x09,
'ENTER': 0x0D,
'CONTROL': 0x11,
'CAPITAL': 0x14,
'ESC': 0x1B,
'SPC': 0x20,
'PGUP': 0x21,
'PGDOWN': 0x22,
'INS': 0x012D,
'DEL': 0x012E,
'WIN': 0x015B,
}
Re: [HELP] How to emulate the Media buttons of my keyboard?
OK guys, that's very simple in EventGhost too, once you know the correct syntax.
However it seems my application eJukebox still doesn't like EventGhost! If I send {Media_Play_Pause} with a AutoHotkey script, it works good. But when I use EventGhost to emulate keystroke {MediaPlayPause}, it doesn't work: eJukebox doesn't react. Mad!
So now the question is: Who is the culprit? EventGhost or eJukebox?!
Thanks a lot for your help.
However it seems my application eJukebox still doesn't like EventGhost! If I send {Media_Play_Pause} with a AutoHotkey script, it works good. But when I use EventGhost to emulate keystroke {MediaPlayPause}, it doesn't work: eJukebox doesn't react. Mad!
So now the question is: Who is the culprit? EventGhost or eJukebox?!
Thanks a lot for your help.
Re: [HELP] How to emulate the Media buttons of my keyboard?
Please tell me how to type combinations like e.g. 'Ctrl++' or 'Ctrl+-' (zoom for Firefox) ? If I try with {Ctrl+Add}, keys from number keyboard are used and they have other functions than the normal ones... How to type combinations like 'Ctrl+?'
Re: [HELP] How to emulate the Media buttons of my keyboard?
To make it easier for others (and for my own reference
) to add media buttons, here's a template which you can paste in your eventghost.xml within a folder 
Code: Select all
<Macro Name="Pause" Expanded="True">
<Action>
Window.SendKeys(u'{Pause}', False)
</Action>
</Macro>
<Macro Name="Play" Expanded="True">
<Action>
Window.SendKeys(u'{Play}', False)
</Action>
</Macro>
<Macro Name="MediaNextTrack" Expanded="True">
<Action>
Window.SendKeys(u'{MediaNextTrack}', False)
</Action>
</Macro>
<Macro Name="MediaPrevTrack" Expanded="True">
<Action>
Window.SendKeys(u'{MediaPrevTrack}', False)
</Action>
</Macro>
<Macro Name="MediaStop" Expanded="True">
<Action>
Window.SendKeys(u'{MediaStop}', False)
</Action>
</Macro>
<Macro Name="MediaPlayPause" Expanded="True">
<Action>
Window.SendKeys(u'{MediaPlayPause}', False)
</Action>
</Macro>
<Macro Name="VolumeMute" Expanded="True">
<Action>
Window.SendKeys(u'{VolumeMute}', False)
</Action>
</Macro>
<Macro Name="VolumeDown" Expanded="True">
<Action>
Window.SendKeys(u'{VolumeDown}', False)
</Action>
</Macro>
<Macro Name="VolumeUp" Expanded="True">
<Action>
Window.SendKeys(u'{VolumeUp}', False)
</Action>
</Macro>
<Macro Name="Backspace" Expanded="True">
<Action>
Window.SendKeys(u'{Backspace}', False)
</Action>
</Macro>
<Macro Name="Escape" Expanded="True">
<Action>
Window.SendKeys(u'{Escape}', False)
</Action>
</Macro>
<Macro Name="Space" Expanded="True">
<Action>
Window.SendKeys(u'{Space}', False)
</Action>
</Macro>
<Macro Name="PageUp" Expanded="True">
<Action>
Window.SendKeys(u'{PageUp}', False)
</Action>
</Macro>
<Macro Name="PageDown" Expanded="True">
<Action>
Window.SendKeys(u'{PageDown}', False)
</Action>
</Macro>
<Macro Name="End" Expanded="True">
<Action>
Window.SendKeys(u'{End}', False)
</Action>
</Macro>
<Macro Name="Home" Expanded="True">
<Action>
Window.SendKeys(u'{Home}', False)
</Action>
</Macro>
<Macro Name="Left" Expanded="True">
<Action>
Window.SendKeys(u'{Left}', False)
</Action>
</Macro>
<Macro Name="Up" Expanded="True">
<Action>
Window.SendKeys(u'{Up}', False)
</Action>
</Macro>
<Macro Name="Right" Expanded="True">
<Action>
Window.SendKeys(u'{Right}', False)
</Action>
</Macro>
<Macro Name="Down" Expanded="True">
<Action>
Window.SendKeys(u'{Down}', False)
</Action>
</Macro>
<Macro Name="Return" Expanded="True">
<Action>
Window.SendKeys(u'{Return}', False)
</Action>
</Macro>
<Macro Name="Insert" Expanded="True">
<Action>
Window.SendKeys(u'{Insert}', False)
</Action>
</Macro>
<Macro Name="Delete" Expanded="True">
<Action>
Window.SendKeys(u'{Delete}', False)
</Action>
</Macro>
<Macro Name="Sleep" Expanded="True">
<Action>
Window.SendKeys(u'{Sleep}', False)
</Action>
</Macro>
<Macro Name="0" Expanded="True">
<Action>
Window.SendKeys(u'0', False)
</Action>
</Macro>
<Macro Name="1" Expanded="True">
<Action>
Window.SendKeys(u'1', False)
</Action>
</Macro>
<Macro Name="2" Expanded="True">
<Action>
Window.SendKeys(u'2', False)
</Action>
</Macro>
<Macro Name="3" Expanded="True">
<Action>
Window.SendKeys(u'3', False)
</Action>
</Macro>
<Macro Name="4" Expanded="True">
<Action>
Window.SendKeys(u'4', False)
</Action>
</Macro>
<Macro Name="5" Expanded="True">
<Action>
Window.SendKeys(u'5', False)
</Action>
</Macro>
<Macro Name="6" Expanded="True">
<Action>
Window.SendKeys(u'6', False)
</Action>
</Macro>
<Macro Name="7" Expanded="True">
<Action>
Window.SendKeys(u'7', False)
</Action>
</Macro>
<Macro Name="8" Expanded="True">
<Action>
Window.SendKeys(u'8', False)
</Action>
</Macro>
<Macro Name="9" Expanded="True">
<Action>
Window.SendKeys(u'9', False)
</Action>
</Macro>
Author of the book Mastering Python. Got Python questions? Perhaps I can help 