Author Topic: Two or more keys to open my GUI?  (Read 1107 times)

GlobalActionMap.bind(keyboard, "x", OPEN_BLIVE_WINDOW);

So far, I've been trying to figure out a good key for opening up my GUI.  X just gets in the way, and @ and & don't even really work.  How can I make it require multiple keys like how BlocklandGlass lets you open with [Ctrl]-[Space]?

I think it's ctrl space



Take a look at this: https://forum.blockland.us/index.php?topic=310669.0

You have to make a custom gui window with an input event (see onInputEvent in the add-on) and make it work properly when someone wants to change the keybind. You can make your own custom gui for it you can package it like I did in my console rebind add-on.

"I think it's ctrl space"

Code: [Select]
exec("./BLIVE_MAIN.gui");

GlobalActionMap.bind(keyboard, "ctrl space", OPEN_BLIVE_WINDOW);

schedule(0, 0, AnnoyTheUser);

function AnnoyTheUser()
{
MessageBoxOK("BLIVE" , "To open up BLIVE's client from anywhere in the game, press @.  With BLIVE open, press ? on your keyboard to access the help menu, [Enter] to open up the addons page, and [Esc] to close the window.");
}

Despite removing BlocklandGlass from my add-ons folder so there's no bind overlapping, ctrl space doesn't work.  What am I missing?



Also, other multi-word/spaced ones don't work, such as trying ALT Y or SHIFT D.

Is OPEN_BLIVE_WINDOW a function?

Is OPEN_BLIVE_WINDOW a function?

The function is nested in my GUI, but it directly references the window control, so the window opens whenever I have a single character call it.

Code: [Select]
function OPEN_BLIVE_WINDOW()
{
Canvas.pushDialog(BLIVE_WINDOW_MAIN);
}

most addons just let the user specify the keybind