Skip to content
Discussion options

You must be logged in to vote

You can do it in one bind: the quotes have to go around the whole list of commands, not just the first one. Since print needs its own double quotes, use single quotes on the outside:

bind v 'toggle r_voxels; print "Voxels is set to: " r_voxels'

How that's parsed, from c_cmds.c / c_console.c:

  • bind takes everything after the control as the action and strips one pair of outer quotes, "…" or '…' (M_StripQuotes). If the action isn't wrapped in quotes, it's rejected as an invalid action. That's what happened with bind v "toggle r_voxels"; if …: the quotes close after toggle r_voxels, so the whole line doesn't start and end with a quote.
  • When you press the key, the bound string is split on ; a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NimanthaData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants