Implementing OnKey events

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

Posts: 9
Joined: Wed Apr 03, 2013 7:13 am

Implementing OnKey events

Post by m42i » Thu Oct 03, 2013 6:46 am

I'm trying to register some keyboard shortcuts for a NewForm panel but I can't get it working.

Here is what I've tried:

Code: Select all

Sub OnStartup
    Set UI = SDB.UI

    Set MainPanel = UI.NewForm
    MainPanel.BorderStyle = 2
    MainPanel.Common.Align = alClient
    Script.RegisterEvent MainPanel.Common, "OnKeyUp", "MainPanelKeyUp"
End Sub

Sub MainPanelKeyUp(Key, State)
    SDB.MessageBox "Key pressed: " + CStr(Key), mtInformation, Array(mbOk)
End Sub
I also tried using MainPanel instead of MainPanel.Common with no luck.