Jump to content
Flirc Forums

Flirc with VLC Media Player


bspan

Recommended Posts

I just got a Flirc USB (new stainless steel version) and I would like to use it to control VLC Media Player on Windows 10. I’m using the “full keyboard” controller in the Flirc GUI.

On USB keyboards, the keys on the numeric keypad (numbers, arithmetic symbols) send different codes than the same keys on the main keyboard. In VLC media player, pressing the + key on the keyboard’s numeric keypad speeds up playback. However, the Flirc GUI “full keyboard” controller does not include a numeric keypad, so I was wondering if there is any way to have Flirc send the codes for the numeric keypad keys.

  • Like 1
Link to comment
Share on other sites

Thank you for the quick reply, I really appreciate it!

I have to say, Flirc is a brilliant idea and I was thrilled when I found it. Its a very elegant and simple solution.

I just tried the command line you suggested, unfortunately it does the same thing as when using the + button in the GUI "full keyboard" controller (the button that has + when shifted and = when not shifted). When VLC is playing a video, pressing the + key on the numeric keypad speeds up the video,  but pressing the + key on the main keyboard (with or without the shift key) is always treated as the = key by VLC.

Another way I can tell the + key on the numeric keypad is a different code than the + key on the main keyboard (+ and = key): when I open Properties for a Windows shortcut and go to the Shortcut key field and I hit the + key on the numeric keypad, the Shortcut Key field displays "Num +" whereas if I hit the + key on the main keyboard (+ and =) with or without the shift key, the Shortcut Key field displays "Ctrl + Alt + ="

I hope all this makes some sense!

 

Link to comment
Share on other sites

Yup, I'll get to it. Thanks so much for hanging in there, sorry for the confusion. 

For anyone wondering how the hell that worked, here is a brief explanation.

The USB keycode for the '+' is in the USB usage table spec, found here: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf

On Page 55, the keypad '+' has the decimal code 87

flirc_util record_api 'usage table' 'key0' 'key1'

They keyboard usage table for flirc is always 1. 

Key0 is the modifier. They are logically or'd together:

#define MOD_CTRL_LEFT               (1<<0)
#define MOD_SHIFT_LEFT              (1<<1)
#define MOD_ALT_LEFT                  (1<<2)
#define MOD_COMMAND_LEFT     (1<<3)
#define MOD_CTRL_RIGHT             (1<<4)
#define MOD_SHIFT_RIGHT            (1<<5)
#define MOD_ALT_RIGHT                 (1<<6)
#define MOD_COMMAND_RIGHT   (1<<7)

So if you want left_control and alt_right, it would be (1<<6) | (1<<0) = 0100 0001 in binary, and in hex: 0x41. or 65 in decimal.

flirc_util record 65 87  would be alt+ctrl and keyboard `+`

I should update the commandline to accept hex instead of decimal. I'll do that now and push it in the next update. 

Link to comment
Share on other sites

Thanks VERY much for this explanation, its very useful info!

I could not figure out how the key code I found in various keyboard tables correlated to the codes in the commandline you provided me. No wonder, its way more involved than I realized.

I've only been tinkering with the Flirc USB a couple of days but I can see it has huge potential for use in all sorts of situations besides multimedia controls (VLC media player in my case). Great product!

Link to comment
Share on other sites

Hello again,

While we’re on the topic of using Flirc commandline record_api to assign Num Pad keys (which do not appear on the “Full Keyboard” controller GUI) to remote control buttons...

Windows 10 has a “Mouse Keys” feature which turns the Num Pad on a computer’s keyboard into a mouse:
Settings > Ease of Access > Mouse > Mouse Keys

By enabling that feature and then using the Flirc commandline record_api command to assign the number keys on the keyboard's Num Pad to the number buttons on my remote, I can now control the on-screen mouse pointer using my Harmony 650 remote, and it works great:

Num Pad 7 key -  flirc_util.exe record_api 1 0 89 (mouse up-left)
Num Pad 8 key -  flirc_util.exe record_api 1 0 90 (mouse up)
Num Pad 9 key -  flirc_util.exe record_api 1 0 91 (mouse up-right)
Num Pad 4 key -  flirc_util.exe record_api 1 0 92 (mouse left)
Num Pad 5 key -  flirc_util.exe record_api 1 0 93 (mouse left click)
Num Pad 6 key -  flirc_util.exe record_api 1 0 94 (mouse right)
Num Pad 1 key -  flirc_util.exe record_api 1 0 95 (mouse down-left)
Num Pad 2 key -  flirc_util.exe record_api 1 0 96 (mouse down)
Num Pad 3 key -  flirc_util.exe record_api 1 0 97 (mouse down-right)

Which leads to a Flirc feature request.....

With the Mouse Keys feature, pressing Ctrl while using the Num Pad number keys causes the mouse pointer to jump a larger distance.  So, I wish the Flirc commandline had a record_api_lp command so I can assign “Ctrl + Num Pad Number Key” to the long press on the remote’s number keys, like this:

flirc_util.exe record_api_lp 1 1 89
flirc_util.exe record_api_lp 1 1 90
Etc....

Thank you for considering this request!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...