Device.setKey

void setKey(uint index, uint keyval, gdk.types.ModifierType modifiers)

Specifies the X key event to generate when a macro button of a device is pressed.

Parameters

indexthe index of the macro button to set
keyvalthe keyval to generate
modifiersthe modifiers to set