Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotkey support #18

Open
bszonye opened this issue Aug 28, 2017 · 2 comments
Open

Hotkey support #18

bszonye opened this issue Aug 28, 2017 · 2 comments

Comments

@bszonye
Copy link
Owner

bszonye commented Aug 28, 2017

A few parts of the map pin interface could use better hotkey support, especially adding and deleting pins. The challenges here are configuration – is it possible to hook into the stock hotkey configuration panel? – and awkward interactions with other controls like the name editor control.

@bszonye
Copy link
Owner Author

bszonye commented Oct 1, 2017

The set of keybindings seem to come from an opaque game object, Input, configured in UI/Options.lua:

  • Input.GetActionCount(): number of keybindings
  • Input.GetActionId(i): get binding by number
  • Input.GetActionId("ToggleYield"): get binding by name
  • Input.BindAction(action, index, gesture): set binding, index = 0 or 1
  • Input.GetGestureDisplayString(action, index): get binding for display

I have not yet found the definition for the set of keybindings and their categories, so that might also be built in and non-modifiable. I would rather not use a custom configuration file for extra keybindings, so this will require more research.

@bszonye
Copy link
Owner Author

bszonye commented Oct 1, 2017

Instead of adding conventional hotkeys for adding & deleting pins, it might be cleaner and more intuitive to use a modifier key. For example, shift+click might drop a pin. Perhaps the shift key could have the same effect as the OnAddPinButton() function:

UI.SetInterfaceMode(InterfaceModeTypes.PLACE_MAP_PIN)

on shift down, and reset it to InterfaceModeTypes.SELECTION on shift up. The same event could also switch the pin list to show a delete button instead of an edit button, for quick delete. This would work well if the key handling can be confined to just the map pin scripts, but if it needs to go into WorldInput.lua it will cause conflicts with other mods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant