Carreau Posted May 29, 2019 Posted May 29, 2019 I want to be able to prompt the player to press a movement key and then script a response based on the player’s input. what i want to ensure is that if a player uses non-WASD layouts, that I can account for that. When I’m waiting for forward (for example), I’d typically look for code 87. But if a user has remapped forward to be E (ESDF), then if I prompt for forward, the user will be pressing the wrong key, right? or do the scan codes get updated when remapping? i don’t even know if there’s a way to pull the key mapping from the user’s settings.
Guest Posted May 29, 2019 Posted May 29, 2019 Scan code are done in a way that makes them independent of the keyboard layout (almost.) So if you use the scancode for 'W' you get it when the key that is where on a US layout the key W is, is pressed.
Carreau Posted May 29, 2019 Author Posted May 29, 2019 And that’s what i figured. So, that means if i wanted to prompt the user for a direction, I’d need to be able to pull their key mapping.
Carreau Posted May 29, 2019 Author Posted May 29, 2019 https://github.com/osvein/f4se-mirror/blob/master/Data/Scripts/Source/User/Input.psc looks like I found my answer. This function didn’t show during my searches of the CK wiki initially. I ended up stumbling on it, and the CK wiki entry is incomplete. But this github page has all the info I need
Guest Posted May 29, 2019 Posted May 29, 2019 CK wiki is not the best source for infos. Most of the relevant info are on Nexus or TESVForum or here.
Carreau Posted May 29, 2019 Author Posted May 29, 2019 99% of everything I've accomplished has been from reading the CK wiki and applying good programming practices. /shrug
Recommended Posts
Archived
This topic is now archived and is closed to further replies.