project-navigation
Personal tools

Author Topic: key bindings  (Read 3854 times)

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
key bindings
« on: June 14, 2007, 11:11:45 pm »
preamble
I have been reading the code trying to understand how the keyboard input works for stuff like crouching, c.

I think Cmd_AddCommand is involved in buttons, and maybe more.
Key_SetBinding gets called when I use bind from the console.

here's the dumb question.
I cant see where the c key is bound to the standcrouch command.

I would be grateful if someone could outline the steps involved in wiring up a keystroke to a function. (maybe you could point me to some general tutorial on the web which describes how this sort of thing is done in c).

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
key bindings
« Reply #1 on: June 15, 2007, 07:13:33 am »
have a look at the bind and unbind console command - also have a look at keys.cfg

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
key bindings
« Reply #2 on: June 15, 2007, 12:05:43 pm »
doh! - I assumed it would be done in a *.ufo or in the code.

I totally forgot about the *.cfg. I have used the bind and undbind console commands.

one more question:
are the cfg files simply acted upon as if they were typed in at the console?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
key bindings
« Reply #3 on: June 15, 2007, 12:52:55 pm »
yes