Platforms to show: All Mac Windows Linux Cross-Platform

Back to CarbonApplicationEventsMBS class.

CarbonApplicationEventsMBS.GestureEnded(GlobalMouseX as Double, GlobalMouseY as Double, WindowHandle as Integer, WindowMouseX as Double, WindowMouseY as Double, WindowPartCode as Integer, KeyModifiers as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 9.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This event is called when the gesture ends.

GlobalMouseX and GlobalMouseY specify the mouse position. If WindowHandle is not 0, it contains the handle for the current window on that mouse position and WindowMouseX/WindowMouseY specify the window relative position. The WindowPartCode specifies which part of the window was hit. (See WindowPartCode definition in Apple documentation.)

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

Return true if you handled the event.

Supported on Mac OS X 10.5.5 and newer.
If not supported with the current hardware, this event is never called.

CarbonApplicationEventsMBS.GestureMagnify(GlobalMouseX as Double, GlobalMouseY as Double, WindowHandle as Integer, WindowMouseX as Double, WindowMouseY as Double, WindowPartCode as Integer, KeyModifiers as Integer, MagnificationAmount as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 9.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This event is called several times while the magnify gesture is performed.

MagnificationAmount the magnification amount.

GlobalMouseX and GlobalMouseY specify the mouse position. If WindowHandle is not 0, it contains the handle for the current window on that mouse position and WindowMouseX/WindowMouseY specify the window relative position. The WindowPartCode specifies which part of the window was hit. (See WindowPartCode definition in Apple documentation.)

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

Return true if you handled the event.

Supported on Mac OS X 10.5.5 and newer.
If not supported with the current hardware, this event is never called.

CarbonApplicationEventsMBS.GestureRotate(GlobalMouseX as Double, GlobalMouseY as Double, WindowHandle as Integer, WindowMouseX as Double, WindowMouseY as Double, WindowPartCode as Integer, KeyModifiers as Integer, RotationAmount as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 9.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This event is called several times while the rotation gesture is performed.

The RotationAmount in polar coordinates.

GlobalMouseX and GlobalMouseY specify the mouse position. If WindowHandle is not 0, it contains the handle for the current window on that mouse position and WindowMouseX/WindowMouseY specify the window relative position. The WindowPartCode specifies which part of the window was hit. (See WindowPartCode definition in Apple documentation.)

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

Return true if you handled the event.

Supported on Mac OS X 10.5.5 and newer.
If not supported with the current hardware, this event is never called.

CarbonApplicationEventsMBS.GestureStarted(GlobalMouseX as Double, GlobalMouseY as Double, WindowHandle as Integer, WindowMouseX as Double, WindowMouseY as Double, WindowPartCode as Integer, KeyModifiers as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 9.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This event is called when a gesture starts.

GlobalMouseX and GlobalMouseY specify the mouse position. If WindowHandle is not 0, it contains the handle for the current window on that mouse position and WindowMouseX/WindowMouseY specify the window relative position. The WindowPartCode specifies which part of the window was hit. (See WindowPartCode definition in Apple documentation.)

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

Return true if you handled the event.

Supported on Mac OS X 10.5.5 and newer.
If not supported with the current hardware, this event is never called.

CarbonApplicationEventsMBS.GestureSwipe(GlobalMouseX as Double, GlobalMouseY as Double, WindowHandle as Integer, WindowMouseX as Double, WindowMouseY as Double, WindowPartCode as Integer, KeyModifiers as Integer, SwipeDirectionX as Double, SwipeDirectionY as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 9.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This event is called for a swipe gesture.

SwipeDirectionX and SwipeDirectionY specify the swipe direction.

GlobalMouseX and GlobalMouseY specify the mouse position. If WindowHandle is not 0, it contains the handle for the current window on that mouse position and WindowMouseX/WindowMouseY specify the window relative position. The WindowPartCode specifies which part of the window was hit. (See WindowPartCode definition in Apple documentation.)

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

Return true if you handled the event.

Supported on Mac OS X 10.5.5 and newer.
If not supported with the current hardware, this event is never called.

CarbonApplicationEventsMBS.HotKeyPressed(signature as Integer, id as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The hotkey was pressed.

Some examples using this event:

CarbonApplicationEventsMBS.HotKeyReleased(signature as Integer, id as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The hotkey was released.

Works not on Carbon inside Mac OS 9!

Some examples using this event:

CarbonApplicationEventsMBS.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 3.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A key was pressed.

Does only work in Carbon target, not in Cocoa. Please use NSEventMonitorMBS class instead.
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

CarbonApplicationEventsMBS.KeyboardRawKeyModifiersChanged(modifierkeys as Integer) as boolean

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

Does only work in Carbon target, not in Cocoa. Please use NSEventMonitorMBS class instead.
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

CarbonApplicationEventsMBS.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 3.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A key is still down.

Does only work in Carbon target, not in Cocoa. Please use NSEventMonitorMBS class instead.
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

CarbonApplicationEventsMBS.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 3.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A key was released.

Does only work in Carbon target, not in Cocoa. Please use NSEventMonitorMBS class instead.
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

CarbonApplicationEventsMBS.MenuPopulate(MenuHandle as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 4.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The system asks the application to update the menu bar.

The application can change the menubar just a second before the user sees it.
This event is also sent whenever a command key is searched.
Works on CarbonLib 1.6 or newer.
Added MenuHandle parameter in v5.2.

CarbonApplicationEventsMBS.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 3.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
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).

CarbonApplicationEventsMBS.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 3.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
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).

CarbonApplicationEventsMBS.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 3.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
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).

CarbonApplicationEventsMBS.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 3.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
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).

CarbonApplicationEventsMBS.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 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever the mouse wheel is moved.
Example
function MouseWheelMoved(modifierKeys as Integer, axis as Integer, delta as Integer) as boolean
Var 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.

CarbonApplicationEventsMBS.ProcessCommand(AttributeFlags as Integer, CommandId as Integer, Handle as Integer, Index as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 3.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever a command is to process.

Called for example when the DockTileMenu is used.
It seems like handle and index are optional.

Renamed Attributes parameter to AttributeFlags in plugin version 8.2.

CarbonApplicationEventsMBS.ServiceCopy(Scrap as CarbonEventsScrapMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever a service needs something from you.

You have to fill the scrap.
Return true if you handled the event.

Some examples using this event:

CarbonApplicationEventsMBS.ServiceGetTypes(copytypes as CFMutableArrayMBS, pastetypes as CFMutableArrayMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever the Mac OS needs to know what types you can process.
Example
function ServiceGetTypes(copytypes as CFMutableArrayMBS, pastetypes as CFMutableArrayMBS) as boolean
pastetypes.Append me.CreateTypeStringWithOSType("TEXT") // Speak text
pastetypes.Append me.CreateTypeStringWithOSType("TIFF") // for Grab

copytypes.Append me.CreateTypeStringWithOSType("TEXT")
end function

Fill the arrays with your content type codes.
Use the CreateTypeStringWithOSType function to make strings with the type codes.
Return true if you handled the event.

Some examples using this event:

CarbonApplicationEventsMBS.ServicePaste(Scrap as CarbonEventsScrapMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever a service gives something to you.

You have to do something with the content of the scrap.
Return true if you handled the event.

Some examples using this event:

CarbonApplicationEventsMBS.ServicePerform(Scrap as CarbonEventsScrapMBS, MessageName as CFStringMBS, UserData as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever you should perform a service.

You have to do something with the content of the scrap.
Return true if you handled the event.

Some examples using this event:

CarbonApplicationEventsMBS.VolumeMounted(VolumeRefNum as Integer, VolumeRoot as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever a volume is mounted.
Example
sub VolumeMounted(VolumeRefNum as Integer)
Var s as String
Var f as FolderItem

f=NewVolumeFolderitemMBS(VolumeRefNum)
if f<>nil then
s=f.DisplayName
end if

List.InsertRow 0,"A volume was mounted: "+s
end sub

VolumeRefNum is the number of the mounted volume. You may keep a list of mounted volumes if you need to know which was is unmounted later.

Some examples using this event:

CarbonApplicationEventsMBS.VolumeUnmounted(VolumeRefNum as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Called whenever a volume is unmounted.
Example
sub VolumeUnmounted(VolumeRefNum as Integer)
// If you keep a list you can identify the volume...
List.InsertRow 0,"A volume was unmounted."
end sub

VolumeRefNum is the number of the mounted volume. You may keep a list of mounted volumes if you need to know which was is unmounted later.

Some examples using this event:

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


The biggest plugin in space...