Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CarbonHotKeyMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Carbon Events MBS MacCF Plugin 2.8 Yes No No Yes, macOS only No
Function: 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.
Notes: 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.

Feedback, Comments & Corrections

This class has no sub classes.

Some examples which use this class:


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


CarbonEventsTimerMBS   -   CarbonMonitorEventsMBS




Links
MBS Xojo PDF Plugins