how to use rotary encoder/knob/dial from USB keyboard

The Virtual Audio Mixer discussions and support...
Post Reply
stephane69
Posts: 6
Joined: Tue Feb 28, 2023 4:56 pm

how to use rotary encoder/knob/dial from USB keyboard

Post by stephane69 »

Hello,

I am working with laptop and additionnal USB keyboard, the last being equipped with the classic multimedia buttons (play, stop, vol +, vol - etc etc), as well as one rotary encoder which controls the sound volume in windows ! And this is very helpfull for me, as very easy to use.

Now that i have switched to VM banana, i am trying to use the same to control the volume...
and that's where the problems begin

- using hook keys or shotcut from VM menu, i can control volume from the +/- volume, from the laptop keyboard... but not from the USB keyboard... it works with laptop keyboard, but it is not exactly what i need, as USB controls buttons do not work in this configuration. (is that strange behaviour ? or normal ?)
- i hence tried the HID options, using macros...
- this last option works, but i can only use the +/- buttons of the USB keyboard, not the rotary encoder !
- in the HID option, in learn mode, i do not see any control ID when i turn the knob... while it works perfectly with buttons ! is that normal ?

MIDI would be a solution, but it then means that i have to buy a controller, which i am not yet willing not.

So... i revert to you all for any suggestion.
any idea ??
xcasxcursex
Posts: 171
Joined: Tue Feb 18, 2020 12:04 am

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by xcasxcursex »

Try different HID devices from the list at the top of the 'Learn' dialog (don't forget to re-check the 'learn' box down the bottom each time you change it).

Your single physical device (the keyboard) might present itself as more than one logical device to the system. For example, this one physical mouse here in my hand is a HID mouse, but also a HID keyboard, HID game controller, and like 5 other things (really!) I forget what they all are. That's really common. To give an idea of the scale of this, the VB Macro learn page shows 30 HID devices on my PC right now and there's only two keyboards and a mouse on here right now.

It's also possible that the volume knob is sending non-standard messages which are interpreted by the software you have to install in order to use it (sometimes called a "driver' but actually not a driver at all, all the USB HID drivers are built in to the operating system), in which case it's not really a USB HID volume control at all, and won't be useful for this purpose. Don't fret though, it's probably not this.

Good luck!
Vincent Burel
Site Admin
Posts: 1904
Joined: Sun Jan 17, 2010 12:01 pm

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by Vincent Burel »

stephane69 wrote: Fri Mar 10, 2023 10:40 am I am working with laptop and additionnal USB keyboard, the last being equipped with the classic multimedia buttons (play, stop, vol +, vol - etc etc), as well as one rotary encoder which controls the sound volume in windows ! And this is very helpfull for me, as very easy to use.
our HID manager learn 2 position button only, but i note your request about "encoder" control... let me know a keyboard reference if possible, then we could make some test with...
stephane69
Posts: 6
Joined: Tue Feb 28, 2023 4:56 pm

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by stephane69 »

Hello Vincent,
thanks for your kiond answer.

I presently use a DELL keyboard SK-8135.
--------
stephane69
Posts: 6
Joined: Tue Feb 28, 2023 4:56 pm

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by stephane69 »

xcasxcursex wrote: Mon Mar 13, 2023 2:22 pm Try different HID devices from the list at the top of the 'Learn' dialog (don't forget to re-check the 'learn' box down the bottom each time you change it).
Your single physical device (the keyboard) might present itself as more than one logical device to the system. For example, this one physical mouse here in my hand is a HID mouse, but also a HID keyboard, HID game controller, and like 5 other things (really!) I forget what they all are. That's really common. To give an idea of the scale of this, the VB Macro learn page shows 30 HID devices on my PC right now and there's only two keyboards and a mouse on here right now.
It's also possible that the volume knob is sending non-standard messages which are interpreted by the software you have to install in order to use it (sometimes called a "driver' but actually not a driver at all, all the USB HID drivers are built in to the operating system), in which case it's not really a USB HID volume control at all, and won't be useful for this purpose. Don't fret though, it's probably not this.
I already tried all HID devices. But no results. And as mentionned by Vincent, it seems that only push buttons are currently taken into account, and encoders and similar type of signals (incremental/decremental signals i guess) aren't.
xcasxcursex
Posts: 171
Joined: Tue Feb 18, 2020 12:04 am

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by xcasxcursex »

I use the rotary encoder on my keyboard for volume control in VB Macro buttons. A rotary encoder is effectively just two normal switches like two normal keyboard keys, they use a technique called quadrature to determine which way you have turned the knob, and then they output one of two normal button press (up or down, left or right, increment or decrement, whatever you call it; depending on which way you turn the knob) just like a normal keyboard key does.
xcasxcursex
Posts: 171
Joined: Tue Feb 18, 2020 12:04 am

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by xcasxcursex »

stephane69 wrote: Thu Mar 16, 2023 9:13 am I presently use a DELL keyboard SK-8135.
A quick search showed me that this keyboard requires "drivers" (not really drivers, as I discussed above) for the special functions like multimedia keys and the encoder knob, to be recognised in windows: https://www.dell.com/community/Desktops ... -p/5045823

If that is the case, then your keyboard is not sending standard USB HID messages. There's an easy way for you to test this: Just plug your keyboard into some other computer that's never seen it before, and turn the knob. If the volume changes, you're good to go :) If not.... Sorry :(

It works fine on my Logitech G810 and my custom made keyboards' (arduinos with my own firmware) encoders, and if your keyboard is sending standard USB HID messages like they do, you should see it in the VB Learn page.
stephane69
Posts: 6
Joined: Tue Feb 28, 2023 4:56 pm

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by stephane69 »

what i am sure of :
i have found without difficulty the HID id of the keybaor din the list.
When in learn mode, pushing any button on the keyboard is displaying a differet bit code etc... hence i am 100% sure that the system works, as i have already made a macro with the multimedia buttons (stop, play etc) to control the tape recorder.

But when turning the knob for voulme... nothing happens except that i see the volume for windows increasing or decreasing... and nothing changes in the learn mode window.

And this is the same whatever i choose push buttons or 2 positions button...

I am not enough skilled to discuss driver issue :-), but quite sure that when i plugged the keyboard usb in the laptop, a driver has been automatically installed by W10.
xcasxcursex
Posts: 171
Joined: Tue Feb 18, 2020 12:04 am

Re: how to use rotary encoder/knob/dial from USB keyboard

Post by xcasxcursex »

stephane69 wrote: Mon Mar 20, 2023 3:03 pm i have found without difficulty the HID id of the keybaor din the list.
There is no "the HID ID of the keyboard". There may be MANY HID IDs of the keyboard. Even for just the one keyboard you hold in your hand, to the computer it can present itself as many separate devices.

For example my Logitech G810, which is a keyboard which has media keys, and an encoder, like your keyboard. It has FIVE HID IDs. One one of them, I can see the media keys (play, stop, pause, skip forward/backward). One another, I can see normal alphanumeric keys (ABCD....). One one of them, I can see my rotary encoder. What the other two are for is not important (also, I forget. hahahah. I think one is mouse emulation and one is for RGB lighting control. Irrelevant anyway)

The point is, just because it is one physical device you can hold in your hand, does not mean it is one device on your PC. This one device in my hand is FIVE devices on my PC. I can use any of these to set up macro buttons. But if I use the wrong one, say i try to use the HID device which has the media keys, then it will not ever work for the volume encoder.

So, do not be misled into thinking that because you can see your multimedia keys working, that you have found the correct HID device for the volume encoder. It may be, or it may not be. You need to check them all.

Here is a step-by-step process:

Open VB Macro buttons. Right-click on a button to configure it. A dialog box will pop up, and in the bottom corner you will see "HID Device Button" and a button next to it labelled 'Config'. Press that 'Config' button. (I guess you are familiar with this part)

At the top of the dialog, you will see "Select HID Device to configure." and below that, a box which says "no HID Device Selected". Click in that box.

Now, use your keyboard's up and down arrows, to scroll through that list. Scroll (with the arrow keys) down some ways so you can make sure it's working, you will see lots of computer mumbo-jumbo there if it is. Then scroll back up until it says "no HID Device Selected". Now you are ready.

Press the down arrow key one time. Wiggle the volume encoder. There is a box labelled "HID Current Data: (when pushing button/key)". Do you see numbers in there changing when you wiggle it? No? Then that is not the right HID device.

Repeat the above process. You may need to do this dozens of times, to check each HID Device.

When you find the right one, click the checkbox labelled "Learn". You will see information in the box labelled "Control Code". Click OK, and you can assign macro button functions to it like normal.

This definitely works, I just did it.


But, all of this operates under the assumption that your rotary encoder is even sending USB HID messages. It's quite possible that it is not. Your keyboard might send some kind of non-standard message to the PC, which is then interpreted by the keyboard's non-standard driver software, and translated into volume up/down keyboard keypresses.

If that is the case, you may still be able to use those keypress messages. When you open the Macro Buttons app, and right-click on a button to configure it, you can see a box on the right side, second row down from the top, labelled "Keyboard Shortcut". Scroll down until you see "VOL MUTE", "VOL -", and "VOL +". They might work, too.

You just need to set up one button for volume up and one button for volume down, and you're all set! :)

I hope this helps!
Post Reply