Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard input not working (KeyboardEvent.key is 0) #1

Open
char opened this issue Nov 15, 2023 · 5 comments
Open

Keyboard input not working (KeyboardEvent.key is 0) #1

char opened this issue Nov 15, 2023 · 5 comments

Comments

@char
Copy link

char commented Nov 15, 2023

On Windows 11, under Bitwig Studio using VST3. Built the plugin. Keyboard input didn't work.

Using a UK English keyboard layout (but it is also broken with Korean and US English key inputs).

So I investigate:

Added a little test on the ImGuiWidget's onKeyboard(..):

template <class BaseWidget>
bool ImGuiWidget<BaseWidget>::onKeyboard(const Widget::KeyboardEvent& event)
{
    if (event.press)
        d_stdout("onKeyboard %u %u %u", event.key, event.mod, event.keycode);
    // et cetera ...

typing 'abcdefg' gives the following in engine.log:

onKeyboard 0 0 65
onKeyboard 0 0 66
onKeyboard 0 0 67
onKeyboard 0 0 68
onKeyboard 0 0 69
onKeyboard 0 0 70
onKeyboard 0 0 71

Looks like maybe a pugl issue? I'm really not sure. The keycode is correctly reported at least, so I can assume US keyboard layout for now and just assign event.key based on the keycode & modifiers.

Here's the bitwig engine.log for '1234567890' which is really weird:

onKeyboard 57353 0 49
onKeyboard 57354 0 50
onKeyboard 57355 0 51
onKeyboard 57413 0 52
onKeyboard 57414 0 53
onKeyboard 57425 0 54
onKeyboard 57427 0 55
onKeyboard 57429 0 56
onKeyboard 61 0 57
onKeyboard 57352 0 48

the reported event.key values are in the Unicode private use area range? '1' becomes U+E009. And '9' becomes U+003D ("=" It even types an equals sign in the text field!!)

An equals sign typed into the 'About' text field

Any insight would be appreciated, but for now I'm just going to fill in event.key based on event.keycode :)

@char char changed the title Keyboard input not working Keyboard input not working (KeyboardEvent.key is 0) Nov 15, 2023
@char
Copy link
Author

char commented Nov 15, 2023

wait I did just realise that I actually updated to the current DPF develop branch with the main revision of dpf-widgets. But I also did not have working keyboard events on the stock version of the plugin in this repo. I'll put my version somewhere for you to look at / test with

@falkTX
Copy link
Contributor

falkTX commented Nov 16, 2023

if you use vst2 or vst3, some events come as part of the plugin spec key handling instead of native window handling. that might explain the weird values.

best would be to try in the standalone and see if it works there first.
that will skip the vst key handling and always use native events

@falkTX
Copy link
Contributor

falkTX commented Nov 16, 2023

we also had some key event fixes on latest dpf + widgets, so best to update those in this repo too. I can do that now

@falkTX
Copy link
Contributor

falkTX commented Nov 16, 2023

ok updated to latest DPF as per 001d107

@char
Copy link
Author

char commented Nov 16, 2023

It does work standalone!! but it still does not work under Bitwig :( Tested with VST2, VST3 and CLAP.

Also, I just found out that keyboard events work just fine with VST3 under Ableton Live!! What gives? Given my previous experiences I would expect Ableton to have worse key handling behavior than Bitwig :o

typing in the box under Ableton Live

I guess this is a host issue? It is receiving the key events though.. it just has the event's key set to 0? I'm not sure what could cause this. I'll try to log out the raw WM_KEYDOWN events and get back to you.

edit: Under Ableton pressing Ctrl (with no other inputs) seems to paste in the box. That's super weird

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants