Open Discord-Github-Bridge opened 10 months ago
GLFW_KEY_V something like that
engineersmith_4628 on Discord says
there's probably a glfw function to translate it to the keyboard
engineersmith_4628 on Discord says
glfwGetKeyName
so something like this?
int scancode = GLFW.glfwGetKeyScancode(GLFW.GLFW_KEY_V); String keyname = GLFW.glfwGetKeyName(GLFW.GLFW_KEY_V, scancode);
not familiar with scancodes
ok
keyname
is v
so ill make a function that returns this
so thats working
so i have the key as a string 'v'
and i need to make it like this: GLFW.GLFW_KEY_V
but obviously that is a variable so
need to use a string as a variable name
Use a map with the string as the key
engineersmith_4628 on Discord says
does minecraft really not load options for you into a java object?
Yea that does seem weird
i couldnt find a function to do that
there probably is
only stuff i can find on google is from 2013
gonna ask on the forge discord
how would this work?
engineersmith_4628 on Discord says
Map<string, glfw...Key> map = Map.of( "a", GLFW_KEY_A, // ... );
but honestly; I wouldn't recommend it unless you're planning on typing all the characters out. I'm sure there is a better way with
Minecraft.getInstance()
No of course not by hand. But I assume at that point you have the list of options no? Then you put each in the map with their mapping
ah yeah Options.class
not sure why i went all the way doing it manually without searching the mc source code for a function to do it
engineersmith_4628 on Discord says
I've done that too often before
its literally right here: minecraft.options.getFile()
this returns a KeyMapping[] object: minecraft.options.keyMappings
engineersmith_4628 on Discord says
let key, options = Ptdye.util.toCharKey(Ptdye.getOption("key_crafting_on_a_stick.key.open_curios"))
👀
i was thinking to do it all in java
engineersmith_4628 on Discord says
Options being (R/L)shift/(R/L)ctrl
engineersmith_4628 on Discord says
let key, options = Ptdye.getOption("key_crafting_on_a_stick.key.open_curios")
?
getKey
why would it return two things?
engineersmith_4628 on Discord says
I'm not sure how keyBindings handle it
engineersmith_4628 on Discord says
but if you have
shift
orctrl
with the binding
still working on this
been busy all day today
i figured out code hotswapping for intellij though so thats cool
Donno what that means but sound cool
minecraft.getMinecraft().gamesettings as a variable that can be accessed in kubejs (even write to a file and read with kubejs)