Esempio n. 1
0
 partial void onEnableF2(NSObject sender)
 {
     if (f2Shortcut == null)
     {
         enableF2.Title       = "Disable Cmd-F2";
         infoText.StringValue = "Cmd-F2 is enabled";
         MASShortcut shortcut2 = new MASShortcut(Keycode.kVK_F2, EventModifier.NSCommandKeyMask);
         f2Shortcut = MASShortcut.AddGlobalHotkeyMonitor(shortcut2, callback);
     }
     else
     {
         enableF2.Title       = "Enable Cmd-F2";
         infoText.StringValue = "Cmd-F2 is disabled";
         MASShortcut.RemoveGlobalHotkeyMonitor(f2Shortcut);
         f2Shortcut = null;
     }
 }
Esempio n. 2
0
 partial void onEnableF1(NSObject sender)
 {
     if (f1Shortcut == null)
     {
         enableF1.Title       = "Disable Cmd-F1";
         infoText.StringValue = "Cmd-F1 is enabled";
         MASShortcut shortcut1 = new MASShortcut(Keycode.kVK_F1, EventModifier.NSCommandKeyMask);
         f1Shortcut = MASShortcut.AddGlobalHotkeyMonitor(shortcut1,
                                                         delegate {
             infoText.StringValue = "Cmd-F1 pressed";
         });
     }
     else
     {
         enableF1.Title       = "Enable Cmd-F1";
         infoText.StringValue = "Cmd-F1 is disabled";
         MASShortcut.RemoveGlobalHotkeyMonitor(f1Shortcut);
         f1Shortcut = null;
     }
 }