SpecialEffect / EyeMineMods

A collection of small minecraft modifications to support the use of an eye-gaze controlled keyboard as input. Designed to accompany EyeMine
https://www.specialeffect.org.uk/eyemine
GNU General Public License v3.0
11 stars 8 forks source link

Safer way to send commands from OptiKey #6

Open kmcnaught opened 7 years ago

kmcnaught commented 7 years ago

It would be nice to be able to have (custom) commands sent from optikey, for example "/effect @p night_vision". This is a little tricky though because of how minecraft handles key presses. If you send the whole string to minecraft in one go, then the later letters get handled before the "/", i.e. they turn lots of mods on or off instead of opening the command/chat pane. Instead you can send "/" on its own to open the chat pane, and then "effect @p night_vision", but this is a bit dangerous if the user sends the second string without having the chat pane open (since most of those letters have keybindings to mods). You could also hook up a new keybinding for opening the chat, which guarantees it will be handled before the rest of the string, but in this case you lose many characters at the start of the command string.

Needs some thought. The naive approach might be to add new keybindings for a limited set of specific commands, but I'm beginning to run out of available keys...