Infrared Wind
Gridologist
Join date: 7 Jan 2007
Posts: 662
|
04-05-2008 04:28
Hi --
I've really tried finding the answer to this: how to catch a listen for a key press. Like H to sound a horn...etc...I know how to catch PgUp and PgDn...via vehicle calls. One plane I have uses G and M.
Thanks for any help.
-i
|
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
|
04-05-2008 06:11
You cant there are only certain keys that you can pickup in LSL
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
04-05-2008 08:04
Since SL is down, I can't test this... but found this snippet on the Wiki: Taking Complete Control There is a handy glitch that can be used to work around a major shortcoming of the control() system. There are many reasons why you might want to grab all the user input and not allow the standard av motion to take effect. For example, creating a custom movement solution. The problem is that avs can not be scripted to rotate so normally using this function to grab all the input controls with accept set to 1 and pass to 0 will prevent a user from turning their av in normal non-mouselook view. You can leave out the right and left rotations but then you won't get events for them. The trick is to make two calls to this function with the correct parameters. Using the following example, you'll take complete control (no normal movement) of all input except for left and right rotation which will behave normally and also generate control() events: run_time_permissions(integer perms) { if (perms & PERMISSION_TAKE_CONTROLS) { llTakeControls(1, 1, 0); // glitch the rotation llTakeControls(desired_controls, 1, 0); } }
... maybe I'm just misunderstanding the wiki  [Edit] Now that I read this again, I guess that «take complete control» refers to the whole set of possible controls. Not, as I assumed, all input a user makes... too bad...
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-05-2008 08:43
you can "listen" for the user to SAY "m"...or you can watch the user's avatar for presence of the "typing" animation or for the presence of the AGENT_IS_TYPING status...
But the only controls you can trigger things from are: up, down, left, right, pgup, pgdwn, left-mouse button, and leftnousebutton in mouselook.There is an exception to this, as holding down shift changes the left and right to "sldestep" left and right.. and those can be detected as well, but the shift key can't be detected on it's own.
You CAN do combos though.. "mousebutton + left" and "pgup + pgdwn" etc.
You might consider building a HUD, which can detect clicks on any of it's buttons.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
Infrared Wind
Gridologist
Join date: 7 Jan 2007
Posts: 662
|
04-05-2008 11:33
From: Winter Ventura you can "listen" for the user to SAY "m"...or you can watch the user's avatar for presence of the "typing" animation or for the presence of the AGENT_IS_TYPING status... I think you just answered my dumb question! 
|