Quote:
Originally Posted by SaschArt
I try to use OnKeyDown(int x, int y, int key) on my custom control, but this function not work in my case, never called.
|
I'm working on Mac with Xcode. I have a control with the following declaration in the "MyControl" class:
Code:
virtual bool OnKeyDown(int x, int y, int key);
And this is the code:
Code:
bool MyControl::OnKeyDown(int x, int y, int key)
{
switch(key)
{
case KEY_LEFTARROW :
deltaX = -8; dlx = deltaX*CellWidth;
break;
case KEY_RIGHTARROW:
deltaX = 8; dlx = deltaX*CellWidth;
break;
...
}
return true;
}
In the WDL implementation, you can only use letters, numbers and arrows (see in IPlugStructs.h).
(I have actually changed the implementation in IGraphicsCocoa.mm and IGraphicsCarbon.cpp to have access to all keyboard keys, and the modifiers key too, which works correctly).