Platforms to show: All Mac Windows Linux Cross-Platform

Back to CarbonMonitorEventsMBS class.

CarbonMonitorEventsMBS.KeyboardRawKeyDown(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
A key was pressed.

If you return true you tell the system that you handled the event.

Possible values for the key modifier:
activeFlag= 1= &h000001
btnState= 128= &h000080
cmdKey= 256= &h000100
shiftKey= 512= &h000200
alphaLock= 1024= &h000400
optionKey= 2048= &h000800
controlKey= 4096= &h001000
rightShiftKey= 8192= &h002000
rightOptionKey= 16384= &h004000
rightControlKey= 32768= &h008000
NumLock= 65536= &h010000
Fn= 131072= &h020000

For added security, GetEventMonitorTarget requires that "Enable access for assistive devices" be checked in the Universal Access preference pane in order to monitor RawKeyDown, RawKeyUp, and RawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor class, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature.

CarbonMonitorEventsMBS.KeyboardRawKeyModifiersChanged(modifierkeys as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
The state of the modifier keys changed.

If you return true you tell the system that you handled the event.

Possible values for the key modifier:
activeFlag= 1= &h000001
btnState= 128= &h000080
cmdKey= 256= &h000100
shiftKey= 512= &h000200
alphaLock= 1024= &h000400
optionKey= 2048= &h000800
controlKey= 4096= &h001000
rightShiftKey= 8192= &h002000
rightOptionKey= 16384= &h004000
rightControlKey= 32768= &h008000
NumLock= 65536= &h010000
Fn= 131072= &h020000

For added security, GetEventMonitorTarget requires that "Enable access for assistive devices" be checked in the Universal Access preference pane in order to monitor RawKeyDown, RawKeyUp, and RawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor class, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature.

CarbonMonitorEventsMBS.KeyboardRawKeyRepeat(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
A key is still down.

If you return true you tell the system that you handled the event.

Possible values for the key modifier:
activeFlag= 1= &h000001
btnState= 128= &h000080
cmdKey= 256= &h000100
shiftKey= 512= &h000200
alphaLock= 1024= &h000400
optionKey= 2048= &h000800
controlKey= 4096= &h001000
rightShiftKey= 8192= &h002000
rightOptionKey= 16384= &h004000
rightControlKey= 32768= &h008000
NumLock= 65536= &h010000
Fn= 131072= &h020000

For added security, GetEventMonitorTarget requires that "Enable access for assistive devices" be checked in the Universal Access preference pane in order to monitor RawKeyDown, RawKeyUp, and RawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor class, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature.

CarbonMonitorEventsMBS.KeyboardRawKeyUp(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
A key was released.

If you return true you tell the system that you handled the event.

Possible values for the key modifier:
activeFlag= 1= &h000001
btnState= 128= &h000080
cmdKey= 256= &h000100
shiftKey= 512= &h000200
alphaLock= 1024= &h000400
optionKey= 2048= &h000800
controlKey= 4096= &h001000
rightShiftKey= 8192= &h002000
rightOptionKey= 16384= &h004000
rightControlKey= 32768= &h008000
NumLock= 65536= &h010000
Fn= 131072= &h020000

For added security, GetEventMonitorTarget requires that "Enable access for assistive devices" be checked in the Universal Access preference pane in order to monitor RawKeyDown, RawKeyUp, and RawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor class, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature.

CarbonMonitorEventsMBS.MouseDown(x as single, y as single, modifierKeys as Integer, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
An event which fires when a mousebuton is down.

In case the tablet property is true, the TabletPoint or the TabletProximity property is filled with an object.

Tablet functions may or may not work in Xojo's debug mode (some RB versions work and some not).

CarbonMonitorEventsMBS.MouseDragged(x as single, y as single, modifierKeys as Integer, deltax as single, deltay as single, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
An event which fires when the mouse is dragged.

In case the tablet property is true, the TabletPoint or the TabletProximity property is filled with an object.

Tablet functions may or may not work in Xojo's debug mode (some RB versions work and some not).

CarbonMonitorEventsMBS.MouseMoved(x as single, y as single, modifierKeys as Integer, deltax as single, deltay as single) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
An event which fires when the mouse is moved.

In case the tablet property is true, the TabletPoint or the TabletProximity property is filled with an object.

Tablet functions may or may not work in Xojo's debug mode (some RB versions work and some not).

CarbonMonitorEventsMBS.MouseUp(x as single, y as single, modifierKeys as Integer, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
An event which fires when a mousebutton is released.

In case the tablet property is true, the TabletPoint or the TabletProximity property is filled with an object.

Tablet functions may or may not work in Xojo's debug mode (some RB versions work and some not).

CarbonMonitorEventsMBS.MouseWheelMoved(modifierKeys as Integer, axis as Integer, delta as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No
Called whenever the mouse wheel is moved.
Example
function MouseWheelMoved(modifierKeys as Integer, axis as Integer, delta as Integer) as boolean
dim d as Integer

const cmdKey=256
const shiftKey=512
const alphaLock=1024
const optionKey=2048
const controlKey=4096
const rightShiftKey=8192
const rightOptionKey=16384
const rightControlKey=32768

const kEventMouseWheelAxisY=1
const kEventMouseWheelAxisX=0

if axis=kEventMouseWheelAxisY then
d=delta

if BitwiseAnd(modifierKeys,optionkey)<>0 then
d=d*4 // scroll faster with option
end if

List.ScrollPosition=List.ScrollPosition-d
end if

List.InsertRow 0,"MouseWheelMoved "+str(delta)
end function

Currently axis is only 0 or 1, but in future new input devices may have up to 32 axises.

Added a boolean function result in version 3.2. If you return true the event is handled by you. Else it's passed to the next receiver of events.

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


The biggest plugin in space...