PDA

View Full Version : shortcuts



eFFeFFe
12-11-2007, 02:06 AM
Hi ... Is it posible with Lscript to set shortcut keys ? For instance, in a lscript panel you have the posibility to select a certain object and to select a certain key. When pressing ok, a keyboard shortcut is created/altered at the selected key with the instruction to select the object that was selected in the lscript panel.


tnx,
eF

Red_Oddity
12-11-2007, 03:04 AM
Well, there is the EditKeys(); command
not sure how it works though, i say check do a search on the forum for this command.

evenflcw
12-11-2007, 03:16 AM
Don't think so. You can't change LW own hotkeys and you can't override them without some C/API programming. TrueArts did manage to take command over the hotkeys in one of their latest plugins (CameraWalker or somesuch). Apparently it wasn't a straightforward task.

But perhaps you could hack it?

With two keypresses - Have a regular LW hotkey open your plugins (pref master or generic) interface out of sight, and process the next key pressed with reqkeyboard().

With one key pressed - request the user to setup x number of standard LW hotkeys to all run your plugin. Perhaps if they press long enough, the key fires more than once and that will be enough to both start the plugin and process the key.

Or you could rely solely on the LW hotkeys maybe. Request user to assign x number of hotkeys to x number of scripts. Each of these scripts are distinguished by name (hotkey1.ls, hotkey2.ls etc). When they are executed a master plugin will be able to parse which was fired, compare that to a list, and perform the appropriate action.

Probably many other ways to hack it. If any of these make sense and will work or something else will, I haven't got a clue about. All of my suggestions seem semicomplex/morronic and the best solution is usually a simple one :-D

evenflcw
12-11-2007, 03:24 AM
EditKeys() only seems to open the Configure Keys panel. Debug says it expects 0 arguments when sending it more. So probably not applicable.

eFFeFFe
12-11-2007, 07:39 AM
mmm ... editkeys() indeed does not seem to give any connections ... evenflcw,
thanks for yer tips/hacks ... the third one interest me, but i need to get more into writing master plugins ... thought it might be easier ... :-)

tnx!
eF.

jeremyhardin
12-11-2007, 09:32 AM
For the master scripts, the panel would have to be at the forefront for it's keys to be picked up with reqkeyboard().