[Solved] Several actions for the same key: possible?
Moderator: Graf Zahl
- Jive
- Posts: 340
- Joined: Sat Mar 11, 2006 23:44
- Location: Manaus (Amazonia)
- Contact:
[Solved] Several actions for the same key: possible?
I need to bind the right button of my mouse with 2 different actions: to open doors AND to straff.
Is there a way to obtain it?
Using the middle button is very uncomfortable, because this button is wheeling each time I use it.
More generally, how it is possible to have several actions for the same key?
Is there a way to obtain it?
Using the middle button is very uncomfortable, because this button is wheeling each time I use it.
More generally, how it is possible to have several actions for the same key?
Last edited by Jive on Sun Jun 25, 2006 21:17, edited 1 time in total.
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Whilst I don't think you can simply bind multiple actions to a single key, the Zdoom console has a fairly powerful launguage. So, you could probably use that to set up an alias that calls the +use and the +strafe commands (or whatever their syntax is) and then bind a key to your alias. Another option you might want to consider is binding your right button to strafe and use the "doublebind" console command to bind a double-click to +use.
If you want a list of all the console commands, type cmdlist at the console. If you want to store them in a text file, type logfile log.txt first. Check the Zdoom Wiki for further information.
http://www.zdoom.org/wiki/index.php?title=Main_Page
If you want a list of all the console commands, type cmdlist at the console. If you want to store them in a text file, type logfile log.txt first. Check the Zdoom Wiki for further information.
http://www.zdoom.org/wiki/index.php?title=Main_Page
-
- Posts: 39
- Joined: Wed Nov 02, 2005 23:21
indeed there is, im pretty sure the bind system is very similer to quakes
bind (key) "+use; +strafe"
im pretty sure that should work, though if you dont hold a button down to strafe, but use 2 buttons to go one way or the other, you will still need 2 keys to do this
if that is the case, try this:
bind (key) "+use; +moveleft"
bind (key) "+use; +moveright"
a small walkthrough for making more if you wish
bind (key) "+use; +strafe"
im pretty sure that should work, though if you dont hold a button down to strafe, but use 2 buttons to go one way or the other, you will still need 2 keys to do this
if that is the case, try this:
bind (key) "+use; +moveleft"
bind (key) "+use; +moveright"
a small walkthrough for making more if you wish

Code: Select all
to make a button do more then one thing, you can setup special binds that combine them like this:
bind (key) "command; command" (the ; is required to seperate the commands. must also be contained with quotation marks, and you can have as many commands as you wish confined in that space, the order of the commands is importent aswell depending on what command you wish to be executed first)
you can even make your commands this way. like this
alias (name) "command; command"
bind (key) (new alias name)
you can make a toggle-able alias by adding + to front of the alias name
and a - to turn it off
alias (+command)
alias (-command)
bind (key) (+command)
and pressing the key again will toggle it off
that will also work with multiple commands aswell
all aliases must be added to your config file by hand and will not be saved if done at the console ingame (if thats the way gzdoom handles it)
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
- Jive
- Posts: 340
- Joined: Sat Mar 11, 2006 23:44
- Location: Manaus (Amazonia)
- Contact:
Before asking, I made my own search, I looked deeply in this wiki, and in the documentation attached to zdoom, and I searched here.Enjay wrote:If you want a list of all the console commands, type cmdlist at the console. If you want to store them in a text file, type logfile log.txt first. Check the Zdoom Wiki for further information.
What seems to me very strange is that I'm pretty sure to have already seen it somewhere, but I don't remember where.

For Doom Legacy, they have added a new cvar "bind key = several", some years ago (thanks to my suggestion to Hurdler. At this time, we were very close, and I was the privileged beta tester of all the releases, because of my capacity to track bugs


- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
- Phobus
- Posts: 227
- Joined: Sat Sep 03, 2005 11:48
- Location: Orpington, Kent, England
- Contact:
- Jive
- Posts: 340
- Joined: Sat Mar 11, 2006 23:44
- Location: Manaus (Amazonia)
- Contact:
Yep, I tried it myself, and I have the same conclusion: don't work!Enjay wrote:See, I was trying that, but I just couldn't get it to work. I was probably typing something incorrectly though.
bind mouse2 "+use; +strafe"
even if I put this line in the "autoexec.cfg" file

Okay, I finally obtained the beginning of a function: mouse2 is opening doors, but my mouse strafe now all the time, even if I don't click!!!
But... I'm now able to zoom and un-zoom


- Jive
- Posts: 340
- Joined: Sat Mar 11, 2006 23:44
- Location: Manaus (Amazonia)
- Contact:
Code pour zoom in and zoom out
Code: Select all
alias zoom_in "set_zoom_out; fov 80; wait 1; fov 71; wait 1; fov 62; wait 1; fov 54; wait 1; fov 46; wait 1; fov 39; wait 1; fov 32; wait 1; fov 26; wait 1; fov 20; wait 1; fov 15; wait 1; fov 10"
alias set_zoom_out "bind z zoom_out"
alias zoom_out "set_zoom_in; fov 15; wait 1; fov 20; wait 1; fov 26; wait 1; fov 32; wait 1; fov 39; wait 1; fov 46; wait 1; fov 54; wait 1; fov 62; wait 1; fov 71; wait 1; fov 80; wait 1; fov 90"
alias set_zoom_in "bind z zoom_in"
bind z zoom_in
The result is to zoom while pressing the key "z", and to come back to a normal view while pressing it again.
Last edited by Jive on Sun Jun 25, 2006 20:55, edited 1 time in total.
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
That's basically the problem I was getting. Either one of the commands was being ignored, or it would get stuck on all the time.Jive wrote:Okay, I finally obtained the beginning of a function: mouse2 is opening doors, but my mouse strafe now all the time, even if I don't click!!!
Oh, and you want r_drawplayersprites 0 to hide the weapons.
- Jive
- Posts: 340
- Joined: Sat Mar 11, 2006 23:44
- Location: Manaus (Amazonia)
- Contact:
Ok, I have it:

I resumed everything HERE
Code: Select all
alias +usestraf "+use; +strafe"
alias -usestraf "-use; -strafe"
bind mouse2 +usestraf

I resumed everything HERE