Two key input at the same time
if i press left and right key at the same time, positive and negative positions neutralize each other. and character wil stop. i want control like Atari 2600 River Raid movement . `If two keys are pressed at the same time, select the last one pressed` . River raid is designed for joystick. I'm talking about Stella emulator controls. The javascript version has similar controls but slightly different -> <https://www.retrogames.cz/play_036-Atari2600.php?language=EN>  

How can i do with Gdscript? thanks.



```
extends KinematicBody2D

var speed = 400
var acceleration = 0.1
var velocity = Vector2.ZERO
var input_velocity = Vector2.ZERO

func _physics_process(delta):
    input_velocity = Vector2.ZERO

    if Input.is_action_pressed("ui_right"):
        input_velocity.x += 1

    if Input.is_action_pressed("ui_left"):
        input_velocity.x -= 1

    input_velocity = input_velocity.normalized() * speed

    if input_velocity.length() > 0:
        velocity = velocity.linear_interpolate(input_velocity, acceleration)
    else:

        velocity = Vector2.ZERO
    velocity = move_and_slide(velocity)

```
Here's an example of one possibility. Just season to taste... 



```
extends Node2D
var x_delta = 0

func _physics_process(delta):
    var input_velocity = Vector2.ZERO

    if Input.is_action_just_pressed("ui_right"):
        x_delta = 1

    if Input.is_action_just_pressed("ui_left"):
        x_delta = -1

    if Input.is_action_just_released("ui_right") && x_delta > 0:
        x_delta = 0

    if Input.is_action_just_released("ui_left") && x_delta < 0:
        x_delta = 0

    input_velocity.x = x_delta

    print(input_velocity.x)

```
[image] ryan\_blything:

i have difficulty understanding why (since ultimately, rts should be dependent on keyboard press rather than frame rate).

builder experiments are structured around a drawing loop and event cycle that is driven by the screen refresh rate. so the keyboard is checked once … yes agreed, the videos are on the older version.

let me help you with the details:

on the new orchestrator the key is under machines tab which you can find under the robot tab.

then click on the view icon to get the key

[image]

[orchestrator 2018.2 practice 2](https://forum.uipath.com/t/orchestrator-2018-2-practice-2/70791/2) [academy](/c/learn/academy)

on… hey [@jsteb](/u/jsteb), i was struggling with this and i figured what is going on. the problem is with the action button. if you try with a regular button it will work. i think that should be clarified in the tutorial Presumably the Save button will already have the focus, so why not just use SendKeys


SendKeys "{Enter}"


HTH,  

Rob The problem is that your pair's closure must return two different types of objects: int if you ask for "con", and the next closure on the line if you ask for "crd".


Here's one possible implementation:


Use a speaker so you can come back.



```
public static Func<string, dynamic> Pair(int x, Func<string, dynamic> y)
{
    Func<string, dynamic> pair =
           (a) =>
           {
               if (a == "con") return x;
               if (a == "crd") return y;
               throw new Exception();
           };

    return pair;
}

public static void Print(Func<string, dynamic> pair)
{
    while (true)
    {
        var next = pair("crd");
        Console.WriteLine((next == null ? "-":"+") +"> " + pair("con"));
        if (next != null)
        {
            Console.WriteLine("|");
            pair = (x) => next(x);
            continue;
        }
        break;
    }
}

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```


  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

Test:



```
var pair = Pair(1,
            Pair(2,
                  Pair(3,
                        Pair(4, null))));

Print(pair);

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

output:



```
+> 1
|
+> 2
|
+> 3
|
-> 4

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
``` You can use SetCursorPos() to control the position of the cursor. It returns true is it succeeds and false if not. It takes 2 arguments int x and int y. You can use GetCursorPos() to retrieve the position of cursor. it returns the same as Set...() it takes one paramater a pointer to a structure of type POINT, which contains to values long x and long y. Also if you want to send Mouse clicks then you will need to look into the function SendInput() its well documented on msdn but feel free to ask for more information.



Chris never mind, finally solved it. i called this.engine.runrenderloop while it’s already running, therefore causing the speed to run twice, because it added a loop/callback the 2nd time.

all i need to do for the ‘resume’ part of my function is to always call this.engine.stoprenderloop() before i call t… okay, i think i see what you’re trying to do. so, it’s similar to the previous answer, but i just added one more line of code from their edit:

@zoom on 188 221 to 243% in 0

&jacob walks to spot 0.506 152 270 in 2 and jacob faces left and jacob starts dance\_lift\_receive\_start then jacob is idle\_lay… to hide files and folders with the same names on left and right:

jscript:

function onclick(clickdata)

{

var cmdsource = clickdata.func.command;

cmdsource.clearfiles();

var cmddest = dopus.create.command;

cmddest.setsourcetab(clickdata.func.desttab);

cmdsource.runcommand("select deselectnomat… correct answer - joystick