[JIRA] Issue Comment Edited: (VWR-16226) llTakeControls() reacts differently to arrow keys than it does the WASD keys, some arrow key combinations impossible to input to script.

Adeon Writer (JIRA) no-reply at lindenlab.cascadeo.com
Sun Nov 29 18:03:02 PST 2009


    [ http://jira.secondlife.com/browse/VWR-16226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=149330#action_149330 ] 

Adeon Writer edited comment on VWR-16226 at 11/29/09 6:02 PM:
--------------------------------------------------------------

it's entirely possible to do using WASD though, there really shouldn't be a difference. I can continue to use WASD for controlling complex scripted systems, but arrow keys are preferable since they work with chat open... very odd bug. And yes, the script is specifically asking for the down level and edge for all three keys at once. It's not that hard to do on WASD, (at least for a gamer ;) ) but the arrow keys don't allow it. They can all be turned on but NOT having all their edges line up. It won't allow it simultaneously.

Interesting find with CONTROL_ROT_LEFT.

I find the following combinations work

Up, left, & down
Up, right & down

While these two do not:

Up, left, & right
Down, left & right

So the problem lies in left and right getting edges at the same time as a third key.
Perhaps somewhere the viewer is marking the left and right presses to cancel each other out.

An example of content that relies on this would be the Vetox Simboards, as left, right, and up activates the "boost" on the vehicle, this can only be activated using the WASD keys as the arrows do not allow that type of input.

      was (Author: Adeon Writer):
    it's entirely possible to do using WASD though, there really shouldn't be a difference. I can continue to use WASD for controlling complex scripted systems, but arrow keys are preferable since they work with chat open... very odd bug. And yes, the script is specifically asking for the down level and edge for all three keys at once. It's not that hard to do on WASD, (at least for a gamer ;) ) but the arrow keys don't allow it. They can all be turned on but NOT having all their edges line up. It won't allow it simultaneously.

Interesting find with CONTROL_ROT_LEFT.

I find the following combinations work

Up, left, & down
Up, right & down

While these two do not:

Up, left, & right
Down, left & right

So the problem lies in left and right getting edges at the same time as a third key.
Perhaps somewhere the viewer is marking the left and right presses to cancel each other out.
  
> llTakeControls() reacts differently to arrow keys than it does the WASD keys, some arrow key combinations impossible to input to script.
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: VWR-16226
>                 URL: http://jira.secondlife.com/browse/VWR-16226
>             Project: 1. Second Life Viewer - VWR
>          Issue Type: Bug
>          Components: Avatar/Character, Scripting, User Interface
>    Affects Versions: 1.23
>         Environment: Windows Vista, USB Keyboard
>            Reporter: Adeon Writer
>
> There is a difference in how keypresses on the WASD keys are handled than that of the arrow keys, and this negatively impacts scripts using llTakeControls(). See code below:
> {code}
> integer controls;
> default
> {
>     state_entry()
>     {
>         controls = CONTROL_FWD | CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT;
>         llOwnerSay((string)controls);
>         llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
>     }
>     run_time_permissions(integer perm)
>     {
>         if(perm & PERMISSION_TAKE_CONTROLS)
>         {
>             llTakeControls(controls, TRUE, TRUE);
>         }
>     }
>     
>     control(key id, integer level, integer edge)
>     {
>         llOwnerSay("level: "+(string)level+" edge:"+(string)edge);
>         llOwnerSay((string)(level & edge & controls));
>         if((level & controls) == controls)
>         {
>             llOwnerSay("You pressed forward, left, and right at the same time.");
>         }
>     }
> }{code}
> The following code, after accepting permissions, would be expected to generate the object saying a message whenever the up, left, and right arrow keys are pressed down at the same time (or, alternatively, the W, A, and D keys)
> Additionally it would be expected to react the same to WASD input as it would arrow key input.
> However you will find that you can generate the message using the WASD keys (provided you remember to minimize the chat bar) however it is not generated by arrow key input.
> Expected behavior would be that the arrow keys function identically to the WASD keys
> This button combination is used for various vehicle and combat systems, and because of that, users are forced to use the WASD keys since scripts do not seem to be able to read this combination from the arrow keys. This could be a problem in the viewer or the server, somewhere along the line, the arrowkey presses aren't being handled properly.
> Edit: Added Harleen's modified code in comments

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.secondlife.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the Jira-notify mailing list