forked from Clones/Controlify
compound binds, complete vanilla compat, better vmouse screen handling, controller uuid, beta notice screen, configurable movement keys, vmouse shift key, icon, optimize controller save/load
This commit is contained in:
@ -34,17 +34,20 @@ public class InGameInputHandler {
|
||||
}
|
||||
|
||||
public void inputTick() {
|
||||
var axes = controller.state().axes();
|
||||
if (minecraft.mouseHandler.isMouseGrabbed() && minecraft.isWindowActive()) {
|
||||
accumulatedDX += axes.rightStickX();
|
||||
accumulatedDY += axes.rightStickY();
|
||||
}
|
||||
handlePlayerLookInput();
|
||||
handleKeybinds();
|
||||
}
|
||||
|
||||
processPlayerLook();
|
||||
protected void handleKeybinds() {
|
||||
if (Minecraft.getInstance().screen != null && !Minecraft.getInstance().screen.passEvents)
|
||||
return;
|
||||
|
||||
if (controller.bindings().PAUSE.justPressed()) {
|
||||
minecraft.pauseGame(false);
|
||||
}
|
||||
if (controller.bindings().TOGGLE_DEBUG_MENU.justPressed()) {
|
||||
minecraft.options.renderDebug = !minecraft.options.renderDebug;
|
||||
}
|
||||
if (minecraft.player != null) {
|
||||
if (controller.bindings().NEXT_SLOT.justPressed()) {
|
||||
minecraft.player.getInventory().swapPaint(-1);
|
||||
@ -55,6 +58,16 @@ public class InGameInputHandler {
|
||||
}
|
||||
}
|
||||
|
||||
protected void handlePlayerLookInput() {
|
||||
var axes = controller.state().axes();
|
||||
if (minecraft.mouseHandler.isMouseGrabbed() && minecraft.isWindowActive()) {
|
||||
accumulatedDX += axes.rightStickX();
|
||||
accumulatedDY += axes.rightStickY();
|
||||
}
|
||||
|
||||
processPlayerLook();
|
||||
}
|
||||
|
||||
public void processPlayerLook() {
|
||||
var time = Blaze3D.getTime();
|
||||
var delta = time - deltaTime;
|
||||
|
Reference in New Issue
Block a user