| Home Page | Recent Changes

GUIUserKeyBinding

UT2003 :: Object >> GUI >> GUIUserKeyBinding (Package: XInterface)

As of build 2181, allows mod authors to add their own key bindings to the standard key binder dialog.

Usage

  1. Subclass GUIUserKeyBinding.
  2. Add entries to the KeyData array:
    • Put the name of a section heading or a key binding in the KeyLabel structure element.
    • Set the bIsSection structure element to True if this entry is a section label and not a key binding.
    • Put the console command you want to bind in the Alias structure element.
  3. Make a MyPackage.int file with the following data in it:

    [Public]
    Object=(Name=MyPackage.MyKeyBindings,Class=Class,MetaClass=XInterface.GUIUserKeyBinding)

    The corresponding MyKeyBinding class:

    class MyKeyBindings extends GUIUserKeyBinding;
    
    // Warning: Don't add any extra spaces between elements in struct variable defaults!
    
    defaultproperties
    {
        KeyData[0]=(KeyLabel="Capture the Mage",bIsSection=True)
        KeyData[1]=(KeyLabel="Cast Spell",Alias="castspell")
        KeyData[2]=(KeyLabel="Activate Shield",Alias="activateshield")
    }

Caveats

  • As of build 2199, UT2003 only supports a limited number of custom key bindings in its standard dialog. Any key bindings going beyond that limit will be ignored.

BigJohn: I have tested this and it doesn't seem to be an issue anymore with ut2004

  • Key bindings created with this method are global in UT2003. To make per-mod key bindings (without resorting to workarounds like using a custom .ini file), you can intercept key press and release events with an Interaction.
  • Note that the sample line stated in the comment header of GUIUserKeyBinding is incorrect.
    Object=(Class=class;MetaClass=Xinterface.GUIUserKeyBinding,Name=<classname>)  - WRONG!
    Object=(Class=class,MetaClass=Xinterface.GUIUserKeyBinding,Name=<classname>)  - correct
    

Related Topics


Category Class (UT2003)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In