Platforms to show: All Mac Windows Linux Cross-Platform

CarbonHotKeyMBS class   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This item is deprecated and should no longer be used. You can use HotKeyMBS instead.
A class for creating hot keys.
Example
const activeFlag                    = 1
const btnState = 128
const cmdKey = 256
const shiftKey = 512
const alphaLock = 1024
const optionKey = 2048
const controlKey = 4096
const rightShiftKey = 8192
const rightOptionKey = 16384
const rightControlKey = 32768

dim MyEvents1 as CarbonApplicationEventsMBS
// use a global property to store your instance of your subclass
dim p as CarbonHotKeyMBS // this should also be global

MyEvents1.Listen

p=new CarbonHotKeyMBS
p.AddKey(&h24, optionKey, OSTypeFromStringMBS("MBSG"), 5)

if p.LastError<>0 then
MsgBox "The Hotkey could not be registered!"
end if

// key will be released when p is destroyed on closing the window.

The CarbonHotKeyMBS has carbon in the name, but works fine with Cocoa, too. The Cocoa event handling system is based internally on the Carbon event handling. If you need to catch NSEvents, please use NSEventMonitorMBS class.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine


The items on this page are in the following plugins: MBS MacCF Plugin.


CarbonEventsTimerMBS   -   CarbonMonitorEventsMBS


The biggest plugin in space...