Index: code/qcommon/cmd.c
===================================================================
--- code/qcommon/cmd.c	(revision 1202)
+++ code/qcommon/cmd.c	(working copy)
@@ -283,6 +283,44 @@
 
 /*
 ===============
+Cmd_PVstr_f
+
+Inserts the current value of a variable as command text
+===============
+*/
+void Cmd_PVstr_f( void ) {
+	char *v = NULL;
+	static qboolean pushed = qfalse;
+
+	// dunno why five...probably because + keys are handled differently...
+	if (Cmd_Argc () != 5) {
+		Com_Printf ("+vstr <variablename1> <variablename2>: execute a variable command on key press and release\n");
+		return;
+	}
+
+	switch( Cmd_Argv( 0 )[0] ) {
+		case '+':
+			v = Cvar_VariableString( Cmd_Argv( 1 ) );
+			pushed = qtrue;
+			break;
+		case '-':
+			// we check this because otherwise key release would fire even in the console...
+			if(pushed) {
+				v = Cvar_VariableString( Cmd_Argv( 2 ) );
+				pushed = qfalse;
+			}
+			break;
+		default:
+			Com_Printf("Cmd_PVstr_f: unexpected leading character '%c'\n", Cmd_Argv( 0 )[0]);
+	}
+	if (v) {
+		Cbuf_InsertText( va("%s\n", v ) );
+	}
+}
+
+
+/*
+===============
 Cmd_Echo_f
 
 Just prints the rest of the line to the console
@@ -726,6 +764,8 @@
 	Cmd_AddCommand ("cmdlist",Cmd_List_f);
 	Cmd_AddCommand ("exec",Cmd_Exec_f);
 	Cmd_AddCommand ("vstr",Cmd_Vstr_f);
+	Cmd_AddCommand ("+vstr",Cmd_PVstr_f);
+	Cmd_AddCommand ("-vstr",Cmd_PVstr_f);
 	Cmd_AddCommand ("echo",Cmd_Echo_f);
 	Cmd_AddCommand ("wait", Cmd_Wait_f);
 }

