Skip to content

HotKeyEvent

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzPlus

HotKeyEvent

HotKeyEvent:Void rawkey:Int32, modifier:Int32, ev_id:Int32, ev_data:Int32=0, ev_x:Int32=0, ev_y:Int32=0, ev_z:Int32=0, ev_source:Int32=0
Parameter Mode Type Default Description
rawkey In Int32 required
modifier In Int32 required Sum of 1 (shift), 2 (control) and 4 (alt).
ev_id In Int32 required
ev_data In Int32 0
ev_x In Int32 0
ev_y In Int32 0
ev_z In Int32 0
ev_source In Int32 0

Description

Makes a key combination produce an event of your choice, even when no gadget wants the key. Handy for shortcuts. The scan code is what KeyDown uses, and the modifiers are added: 1 shift, 2 control, 4 alt.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Hot key", 20, 20, 240, 100, Desktop(), 3)
HotKeyEvent 31, 2, $4242, 7 ; Ctrl+S
Repeat
	e = WaitEvent()
	If e = $4242 Then SetGadgetText win, "Saved " + EventData()
Until e = $803

Related Commands

FontSize, FontStyle, Notify, PauseTimer

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally