I want to define more keys
I know there are defined in PlayerCommands.hpp, but which Keys are which Bits
Could anyone help me
New Keys - Which Bits
Re: New Keys - Which Bits
Hello!
Below I provide you the list of bindings of "real keys" to the bits defined in PlayerCommand.hpp. This list however, can currently not be changed.
For writing new code for changing this list, I'd first like to understand how Q3, D3, etc. handle their key binding. As fas as I can say now, in the .cfg files, they bind keys to console commands. That is, after e.g.
bind "a" "_moveleft"
pressing "a" causes the _moveleft console function to be called, probably with an argument indicating wether the button went up (released) or down (pressed). The console functions then assemble the bitfield that is required for network transmission.
(Does entering "_moveleft 1" into the console start the player to move left? I'll try later...)
Thus, completing a custom keybinding ideally requires a console var/func system to be implemented (at least when implemented as outlined above). Completing a cvar system for Ca3DE is one of the things I'm currently working on, so I hope that we'll get a solution for this soon enough.
The keys 0, 1, ... 9 (both on keyboard as well as num-pad) are stored nummerically in the top four bits, where the 1 key maps to 0x10000000, the 9 key maps to 0x90000000, and the 0 key maps to 0xA0000000. (That is, only one of them can be pressed at a time.)
Sorry for the limitations that Ca3DE currently has. Hope this helps anyway.
That, unfortunately, is not quite that easy in the current release of Ca3DE.TheMatrix wrote:I want to define more keys
Below I provide you the list of bindings of "real keys" to the bits defined in PlayerCommand.hpp. This list however, can currently not be changed.
For writing new code for changing this list, I'd first like to understand how Q3, D3, etc. handle their key binding. As fas as I can say now, in the .cfg files, they bind keys to console commands. That is, after e.g.
bind "a" "_moveleft"
pressing "a" causes the _moveleft console function to be called, probably with an argument indicating wether the button went up (released) or down (pressed). The console functions then assemble the bitfield that is required for network transmission.
(Does entering "_moveleft 1" into the console start the player to move left? I'll try later...)
Thus, completing a custom keybinding ideally requires a console var/func system to be implemented (at least when implemented as outlined above). Completing a cvar system for Ca3DE is one of the things I'm currently working on, so I hope that we'll get a solution for this soon enough.
I know there are defined in PlayerCommands.hpp, but which Keys are which Bits
Code: Select all
PCK_MoveForward =0x00000001; // UP arrow or W.
PCK_MoveBackward=0x00000002; // DOWN arrow or S.
PCK_TurnLeft =0x00000004; // LEFT arrow.
PCK_TurnRight =0x00000008; // RIGHT arrow.
PCK_StrafeLeft =0x00000010; // A or ,
PCK_StrafeRight =0x00000020; // D or .
PCK_LookUp =0x00000040; // Page Down.
PCK_LookDown =0x00000080; // Page Up.
PCK_CenterView =0x00000100; // End.
PCK_Jump =0x00000200; // SPACE.
PCK_Duck =0x00000400; // (unused / not bound)
PCK_Walk =0x00000800; // Left or right SHIFT.
PCK_Fire1 =0x00001000; // Mouse button 0 or R.
PCK_Fire2 =0x00002000; // Mouse buttons 1 or 2.
PCK_Use =0x00004000; // RETURN or ENTER.
Sorry for the limitations that Ca3DE currently has. Hope this helps anyway.
Best regards,
Carsten
Carsten
Who is online
Users browsing this forum: No registered users and 8 guests