Platforms to show: All Mac Windows Linux Cross-Platform

Back to CarbonApplicationEventsMBS class.

Next items

CarbonApplicationEventsMBS.ApplicationActivated

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No
Called whenever your application is actived.

In older versions this event was misspelled: ApplicationActived

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationDeactivated

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No
Called whenever your application is deactivated.

In older versions this event was misspelled: ApplicationDeactived

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationGetDockTileMenu as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 3.0 ✅ Yes ❌ No ❌ No ❌ No
Called whenever the system likes to know which menu to display in the dock tile.

Create a menu using the MenuMBS class and return the handle property to this event as the result.

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationHidden

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No
The application was hidden.

Only used on Mac OS X 10.2 and newer.

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationLaunched(ProcessSerial as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No
Called whenever an application is launched.

ProcessSerial is a memoryblock to 8 bytes defining the process serial number.
ProcessSerial may be nil on very low memory.

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationQuit

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 5.3 ✅ Yes ❌ No ❌ No ❌ No
The application is requested to quit.

Current Xojo versions seems to handle this event before the plugin can get it, so currently this event does not fire. (tested with RB 5.5 and 2005r2)

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationShown

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No
The application was shown.

Only used on Mac OS X 10.2 and newer.

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationSwitched(ProcessSerial as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No
Called whenever the frontmost application is changed.
Example
sub ApplicationSwitched(ProcessSerial as memoryblock)
' This even works in built applications.
dim s as String
dim p as ProcessMBS

if ProcessSerial<>nil then
p=new ProcessMBS

p.GetProcess(ProcessSerial)
p.Update
s=p.Name
end if
List.InsertRow 0,"Application switched to "+s+"."
end sub

ProcessSerial is a memoryblock to 8 bytes defining the process serial number.
ProcessSerial may be nil on very low memory.

Some examples using this event:

CarbonApplicationEventsMBS.ApplicationSystemUIModeChanged(SystemUIMode as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No
The system UI mode changed.

Only used on Mac OS X 10.2 and newer.

CarbonApplicationEventsMBS.ApplicationTerminated(ProcessSerial as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Carbon Events MBS MacCF Plugin 2.8 ✅ Yes ❌ No ❌ No ❌ No
Called whenever an application quits.

ProcessSerial is a memoryblock to 8 bytes defining the process serial number.
ProcessSerial may be nil on very low memory.

Note that the process serial number may no longer be valid when this event is called.

Some examples using this event:

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.

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
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
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
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
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
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:

Next items

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


The biggest plugin in space...