• 04Dec

    Today, I was writing up a huge post about custom keyboard shortcuts. I was covering all the bases: why keyboard shortcuts make everything happy and warm, the ways in which SL’s shortcuts are poo, and how Linden Lab could and should implement custom keyboard shortcuts. During my research into this last aspect, I realized something:

    I can do it myself.

    In fact, I not only can do it, I have done it. As a proof of concept, I successfully remapped the Ctrl-Shift-M shortcut. It had previously been bound to View > Mini-Map; it is now, for my Viewer, bound to World > Force Sun > Midnight.

    This is just the beginning.

    For the curious, here’s how I did it.

    Second Life’s user interface is (at this point in the time, but not so in the past) defined as XML located in the skins/xui/xyz/ directory (where xyz is the language code; for English readers like myself, it’s en-us). The XML for the menu bar along the top of the viewer is in the menu_viewer.xml file.

    The majority of this file are <menu_item_call> tags, one block for each menu item. One of the possible attributes for this tag is “shortcut”. The values for the shortcut attribute are a pipe-separated list of modifiers followed by a key. For example, the “Ctrl-Shift-M” key combination is expressed as "control|shift|m".

    Make a backup copy of menu_viewer.xml before you make any changes, in case you break something and need to revert. Then use a text editor (or, if you have one, a dedicated XML editor) to open the file. Find the entry for “Mini-Map”, and cut out the part that says: shortcut="control|shift|m". Then find the entry for “Midnight”, and paste it after name="Midnight" (but before the closing brace; and don’t forget to put a space between between the quote after Midnight and the beginning of shortcut).

    That’s it. Start up SL, and if everything went as planned, the “World > Force Sun > Midnight” menu item will show a shortcut key combo next to it, and “View > Mini-Map” will not. You can press Ctrl-Shift-M to see for yourself that it now forces the sun to midnight.

    Like I said earlier: This is just the beginning. There are dozens of other XML files in that same folder, defining such things as the layout of the edit window, the min and max values of number entry forms, and many, many other things which I intend to experiment with.

    I will close with this disclaimer: I re-read the SL Terms of Service tonight, especially section 4.2, which covers accessing SL with “unauthorized” software (this is one of the sections that was amended after the recent CopyBot scare). And although I think that modifying the XML files accessed by the SL Viewer client is probably not a violation of the spirit of the TOS, should you choose to do it, you do so at your own risk.

    It would be a mistake for Linden Lab to discipline anyone for trying to improve their own user experience without harming others; but it wouldn’t be Linden Lab’s first. Fair warning.

    Posted by Jacek Antonelli @ 7:29 pm

2 Responses