Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - marasahh9

Pages: [1]
General discussions / Re: Better keyboard handling
« on: September 06, 2022, 10:06:13 am »
Mm, input bindings is an important feature. I map virtual keys -> "actions", which are just strings. For example, A and Left Arrow are bound to "menu_left". The game only listens for active actions, never actual keys. Notes:

I've added filters for e.g. initial press, release, and repeat events. E.g. GetAction("menu_left", Filter.Press) to get initial key press only.

Since I'm using virtual keys for input, the location of the key does not change on e.g. a DVORAK keyboard.

Allows seamless binding of e.g. gamepad input to actions as well.

The system can retrieve the name of the keys that are bound to an action. E.g. ask for "menu_left", output the name of the virtual keys that are bound to it ("A" and "Left Arrow"). This relies on OS functions that returns the name of a given virtual key. When several names are returned, I just use the first on in the list when displaying it ingame.

Making a system like this is of course some work, but IMO worth the trouble.

Pages: [1]