Posted March 2, 20169 yr Hello, I'm trying to get the CraftingKeys mod working in combination with a eye tracking keyboard to make crafting more accessible to people unable to use a keyboard/mouse. One classic problem with alternative keyboard inputs is that they tend to give instantaneous key press events, rather than slow finger presses - this means that you almost never detect the key events when polling isKeyDown(). What's the best approach to detecting key events while the inventory is open? The mod's onKeyInput() method only gets called in-game (not when the inventory is open). I've tried iterating over the whole event queue, which does successfully find the events I care about, but it also consumes any other events, so that other keys don't work (such as pressing Esc to close the inventory). Is there some way I can subscribe to key events within the vanilla inventory GUI? Or should I be re-publishing events that I consume but don't care about? The latter seems a bit low-level to me. Any pointers would be greatly appreciated, Kirsty
March 2, 20169 yr You might have to get a bit low-level for this one, since it's a hardware related issue. What I'd perhaps do is look at how InventoryTweaks does it. Here's a link to the class: https://github.com/Inventory-Tweaks/inventory-tweaks/blob/develop/src/main/java/invtweaks/InvTweaks.java
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.