(feature) reload mouse when toggle raw mouse input

This commit is contained in:
kirillsaint 2024-01-19 21:26:33 +06:00
parent 498847d881
commit d3d05db169
2 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class GeneralMod extends Mod {
public void onChangeSettingValue(Setting setting) { public void onChangeSettingValue(Setting setting) {
switch(setting.getName()) { switch(setting.getName()) {
case "Raw Mouse Input": case "Raw Mouse Input":
RawInputHandler.reload();
RawInputHandler.toggleRawInput(setting.getValBoolean()); RawInputHandler.toggleRawInput(setting.getValBoolean());
break; break;
case "Menu Background Blur": case "Menu Background Blur":

View File

@ -19,6 +19,10 @@ public class RawInputHandler {
startThread(); startThread();
} }
public static void reload() {
controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
}
public static void getMouse() { public static void getMouse() {
for (int i = 0; i < controllers.length && mouse == null; i++) { for (int i = 0; i < controllers.length && mouse == null; i++) {
if (controllers[i].getType() == Controller.Type.MOUSE) { if (controllers[i].getType() == Controller.Type.MOUSE) {