Allow raw key handlers to cancel keybindings (required for #305)
So that when you press e.g. Ctrl+Z, it doesn't trigger the keybinding bound to Z (currently full brightness).
This commit is contained in:
@@ -97,9 +97,8 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
||||
settingsRegistry.set(Setting.AUTO_SYNC, active);
|
||||
settingsRegistry.save();
|
||||
});
|
||||
core.getKeyBindingRegistry().registerRaw(Keyboard.KEY_DELETE, () -> {
|
||||
if (guiPathing != null) guiPathing.deleteButtonPressed();
|
||||
});
|
||||
core.getKeyBindingRegistry().registerRaw(Keyboard.KEY_DELETE, () ->
|
||||
guiPathing != null && guiPathing.deleteButtonPressed());
|
||||
keyPositionKeyframe = core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.positionkeyframe", Keyboard.KEY_I, () -> {
|
||||
if (guiPathing != null) guiPathing.toggleKeyframe(SPPath.POSITION, false);
|
||||
}, true);
|
||||
|
||||
@@ -468,10 +468,12 @@ public class GuiPathing {
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteButtonPressed() {
|
||||
public boolean deleteButtonPressed() {
|
||||
if (mod.getSelectedPath() != null) {
|
||||
toggleKeyframe(mod.getSelectedPath(), false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void startLoadingEntityTracker() {
|
||||
|
||||
Reference in New Issue
Block a user