Posted March 17, 20232 yr holl good days im doing something with keybindings and i want this actions set to activated some traps and i want set this action to combination of keys but the player must have the possibility to change this keys so basically i need to establish mi keybind to leftshift + x leftshift + c leftshift + v leftshift + left control but the key bind tutorial im folowing only allows one key per action in this case the default gonna be the leter "O" [GLFW.GLFW_KEY_O] // public class KeyBinding { public static final String KEY_CATEGORY_TUTORIAL = "Merctool"; public static final String KEY_DRINK_WATER = "Drink_WATA"; public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, KEY_CATEGORY_TUTORIAL ); //<------- ?? } ## how i do to set this KeyMapping to use two keys ¿¿ GLFW.GLFW_KEY_LEFT_SHIFT + GLFW.GLFW_KEY_LEFT_CONTROL ?????? sooo by default looks like this Edited March 17, 20232 yr by perromercenary00 solved
March 17, 20232 yr Unless it's not working, I think that is how it should look. Additionally, SHIFT and Left Control are already bound to Crouch and Sprint, so that might be a contributing factor as to why it wouldn't work. I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?
March 17, 20232 yr Author o nonono mi english is not soo good when you define a keybind you do an public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, <------- KEY_CATEGORY_TUTORIAL ); this lines define the keybind and set the initial/default value to "O" the user can change it later to whatever hi want in the menu i want in this case the initial/default value to be control + shift and the player can change it later if it want it public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, keys=[GLFW.GLFW_KEY_LEFT_SHIFT + GLFW.GLFW_KEY_LEFT_CONTROL], <------- this part of here KEY_CATEGORY_TUTORIAL );
March 17, 20232 yr Author i found something public static final KeyMapping DRINKING_KEY = new KeyMapping( "DrinkingWater", KeyConflictContext.IN_GAME, KeyModifier.SHIFT, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_LEFT_CONTROL, KEY_CATEGORY_TUTORIAL ); KeyModifier.SHIFT, KeyModifier.CONTROL,KeyModifier.ALT is weird coze you cannot combine whatever you want only this 3 options but its good enough for me soo it leit as solved
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.