Upload files to "src/openonyx/input"

This commit is contained in:
winterflyt committed 2026-11-30 06:02:14 +02:00
1 parent a352ff2926
commit 8fe58141d2
4 files changed
+207

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
package openonyx.input;
public record CharInput(int codepoint, int modifiers) {
public CharInput(char c) {
this(c, 0);
}
public static String decrypt(String string) {
String string1 = string;
int p = (--3 ^ 5) << 4 ^ 10;
int q = 4 << 4 ^ 6;
String string2;
int r = (string2 = string1).length();
char[] e = new char[r];
boolean bl = true;
int k;
int n = k = r - 1;
char[] c = e;
int j = q;
int o = 58;
int l = n;
int i = p;
while (l >= 0) {
int m = k;
char d = string2.charAt(k);
k--;
c[m] = (char)(d ^ i);
if (k < 0) {
break;
}
o = k--;
c[o] = (char)(string2.charAt(o) ^ j);
l = k;
}
return new String(c);
}
}
+61
View File
@@ -0,0 +1,61 @@
package openonyx.input;
import net.minecraft.client.gui.GuiScreen;
public record KeyInput(int key, int scancode, int modifiers, char typedChar) {
public boolean i() {
return this.D();
}
public boolean D() {
return GuiScreen.isCtrlKeyDown() && GuiScreen.isCtrlCharTyped(this.typedChar);
}
public boolean d() {
return GuiScreen.isShiftKeyDown();
}
public boolean L() {
return GuiScreen.isAltKeyDown();
}
public static String decrypt(String string) {
String string1 = string;
int l = 5 >> 1 << 3 ^ 4;
int m = 4 << 4 ^ 2 << 2 ^ 1;
String string2;
int o = (string2 = string1).length();
char[] d = new char[o];
boolean bl = true;
int j;
int n = j = o - 1;
char[] c = d;
byte b = 41;
l = n;
int i = m;
while (l >= 0) {
m = j;
int k = string2.charAt(j);
j--;
c[m] = (char)(k ^ i);
if (j < 0) {
break;
}
k = j--;
c[k] = (char)(string2.charAt(k) ^ b);
l = j;
}
return new String(c);
}
public KeyInput(int i) {
this(i, 0, 0, '\u0000');
}
public KeyInput(int i, int j, int k) {
this(i, j, k, '\u0000');
}
}
+71
View File
@@ -0,0 +1,71 @@
package openonyx.input;
import java.util.Arrays;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
public final class KeyStateTracker {
private static final boolean[] H;
private static boolean e = true;
private KeyStateTracker() {
}
private static boolean L(int i, int j) {
return L(i) || L(j);
}
private static boolean L(int i) {
if (!H[i]) {
return false;
}
if (Keyboard.isKeyDown(i)) {
return true;
}
H[i] = false;
return false;
}
public static boolean i() {
return L(42, 54);
}
public static void d() {
Arrays.fill(H, false);
}
public static boolean D() {
return L(29, 157);
}
public static void L() {
boolean bl;
if (!(bl = Display.isActive()) || !e) {
d();
}
e = bl;
}
public static boolean d() {
return L(56, 184);
}
public static boolean L() {
return L(219, 220);
}
public static void L(int i, boolean bl) {
if (i > 0 && i < H.length) {
H[i] = bl;
}
}
static {
boolean[] bl = new boolean[256];
boolean bl1 = true;
H = bl;
}
}
+35
View File
@@ -0,0 +1,35 @@
package openonyx.input;
public record MouseInput(double x, double y, int button) {
public static String decrypt(String string) {
String string1 = string;
int n = (--3 ^ 5) << 4 ^ 14;
String string2;
int p = (string2 = string1).length();
char[] e = new char[p];
boolean bl = true;
int j;
int o = j = p - 1;
char[] c = e;
byte b = 43;
byte d = 40;
int k = o;
int i = n;
while (k >= 0) {
int l = j;
int m = string2.charAt(j);
j--;
c[l] = (char)(m ^ i);
if (j < 0) {
break;
}
m = j--;
c[m] = (char)(string2.charAt(m) ^ b);
k = j;
}
return new String(c);
}
}