C.60. $world->macro

Abstract

$world->macro function: creates a MACRO

void $world->macro( keycode ,
  action ,
  [attributes] );
 
void $world->macro( number ,
  [keycode ,
  [action]] ,
  [attributes] );
 

Creates a new macro, or edits the macro identified by number. keycode represents a key such as "KP_Home" or "<Control>F12". The format is the one accepted by the GTK+ function gtk_accelerator_parse(), but most of the time you will want to use the $world->getkeycode function to retrieve the keycode for a given key. action is what will be executed when the key (or keys) is pressed.

Atributes is a reference to a hash defining attributes for the macro. Generally the call works like this:

$world->macro("keycode", "action", { attribute1 => value1,
                                     attribute2 => value2, ... })

Possible attributes: