Blitz3D+ Command Reference

CreateHotKeyField ( x,y,width,height,group[,style] )

Parameters

x,y - position of the field's top-left corner within the group's client area

width,height - size of the field

group - window or gadget group that owns the field

style (optional) - 0 (default); other values are reserved

Description

Creates a field that captures a keyboard shortcut from the user, and returns its handle.

Requires Extended language mode.

The standard "press a key combination" control for a tool's settings panel: the user clicks the field, presses something like Ctrl+R, and the field displays and remembers it. Read the captured combination with HotKeyFieldKey (a raw keyboard scan code, the same codes key events carry) and HotKeyFieldModifiers (Shift 1, Control 2, Alt 4), or preset it with SetHotKeyField.

Capturing is all the field does - it deliberately does not install a global shortcut. To make the combination live, pass the captured values to HotKeyEvent, which posts an event of your choosing whenever the combination is pressed. That split lets you validate or confirm before committing a binding.

When the user changes the field, it posts a critical gadget-action event ($401) with the raw key in EventData and the modifier bits in EventX.

See it working in the native input controls sample, which rebinds a working reset shortcut on the fly.

See also: SetHotKeyField, HotKeyFieldKey, HotKeyFieldModifiers, HotKeyEvent, EventData.

Index