COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 07-06-2016, 03:38 PM   #1
Jansku
Human being with feelings
 
Join Date: May 2013
Location: Oulu
Posts: 36
Default KeyDown does not work on Windows?

Hey guys,

I have a bit of an issue: my plugin has one control which calls in for keydown if mouse cursor is on top of the controller and works perfectly on Mac. However, if I press any of the keyboard up,down,left or right keys on Windows, nothing happens.

Could someone point a way how to capture / overrider the host keycapture on Windows environment? I've searched the forums several times with several different terms, but nothing seems to help so far. Is there a way to tell the host or the plugin that the mouse is over the control so it would capture it without major hacks?

Thanks in advance!
Jansku is offline   Reply With Quote
Old 07-07-2016, 03:47 AM   #2
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

See this for windows. https://github.com/olilarkin/wdl-ol/...csWin.cpp#L290
Youlean is offline   Reply With Quote
Old 07-07-2016, 04:51 AM   #3
Jansku
Human being with feelings
 
Join Date: May 2013
Location: Oulu
Posts: 36
Default

Quote:
Originally Posted by Youlean View Post
Yes, but it is not triggered when I push a key on my computer :/
Jansku is offline   Reply With Quote
Old 07-07-2016, 07:47 AM   #4
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

Add this code above case WM_KEYDOWN:
Code:
 	case WM_GETDLGCODE:
		return DLGC_WANTALLKEYS;
See more info here: https://forum.juce.com/t/vst-plugin-...trokes/1633/76
Youlean is offline   Reply With Quote
Old 07-07-2016, 03:56 PM   #5
Jansku
Human being with feelings
 
Join Date: May 2013
Location: Oulu
Posts: 36
Default

Quote:
Originally Posted by Youlean View Post
Add this code above case WM_KEYDOWN:
Code:
 	case WM_GETDLGCODE:
		return DLGC_WANTALLKEYS;
See more info here: https://forum.juce.com/t/vst-plugin-...trokes/1633/76
YESSSS!!! Thanks a million dude! That worked out just like it has to!

New question is, how could I turn this into a setting inside the plugin, so that if switch is on -> keyboard gets captured in plugin and when off, it would not? Is that even possible?
Jansku is offline   Reply With Quote
Old 07-07-2016, 05:45 PM   #6
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 654
Default

This is not possible, but you can override OnKeyDown function in you custom class ans do stuff there...
Youlean is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.