Author Topic: Client-sidedly pressing a key  (Read 1571 times)

I was wondering how to trigger a key event from a client-sided script. How do you do it? I searched for a long time, and could find nothing.
I also tried console tracing, but it didn't show anything when I pressed the "Enter" key, or any other key.
« Last Edit: August 26, 2013, 10:29:34 AM by hammereditor² »

What is your goal here? Do you want to make a key bind?

What is your goal here? Do you want to make a key bind?
I don't want to make a keybind.
I want to programatically press the "ESC" key.

%command = moveMap.getCommand("keyboard", "escape");

call(%command, 1);
call(%command, 0);

For future reference:

string getBinding(string command)
    Gets the ActionMap binding for the specified command.

string getCommand(string device, string action)
    Gets ActionMap command for the device and action.

string getDeadZone(string device, string action)
    Gets the Dead zone for the specified device and action.

float getScale(string device, string action)
    Get any scaling on the specified device and action.

bool isInverted(string device, string action)
    Determines if the specified device and action is inverted.

%command = moveMap.getCommand("keyboard", "escape");

call(%command, 1);
call(%command, 0);

This doesn't work. I found out that '%command' equals "escapeMenu.toggle()".
I want to just send the key event instead of pushing the escapeMenu dialog.
Specifically, I want to pop the "SAY: " thing which appears when you press the "T" key to chat.
« Last Edit: August 26, 2013, 03:36:57 PM by hammereditor² »

This doesn't work. I found out that '%command' equals "escapeMenu.toggle()".
I want to just send the key event instead of pushing the escapeMenu dialog.
Specifically, I want to pop the "SAY: " thing which appears when you press the "T" key to chat.

Try canvas.popDialog(newMessageHUD); That should work.

I want to just send the key event instead of pushing the escapeMenu dialog.

That is the closest TGE comes to sending key events.

Try canvas.popDialog(newMessageHUD); That should work.
Thank you; it works!

Don't remove your code when you "solve" the problem.

Why does it not work? Calling the parent in that function should close the hud.