[Bug] Cannot close in-game console

Hi all,

I just came back to this game after not playing for a few years.
Since then I moved to Linux.

Installation went flawless (just copied from an old machine) except that now steam is a requirement?!
I got the retail version from ages ago.
Also let me rant real quick that the nicely colored name from my config isn’t being used anymore.
But I get it, you couldn’t properly ban people otherwise.

Either way… It seems that you re-implemented the in-game console handling.
(IIRC in older codx versions the enable console option was still present in the game settings.)

So here’s the problem: The console can be opened using Shift + the key left to 1 on the keyboard.
But cannot be closed. This is on QWERTZ layout.

I noticed that when I rebind toggleconsole in the config and use the new key instead, Shift or not, then the game prints something like “Unknown command toggleconsole” (translated; non-english installation).

I also notice that I cannot type ~ either into the console or chat (AltGr + + on QWERTZ, which is ] on QWERTY I think) - it’s silently ignored - which suggests to me that opening/closing have inconsistent logic and that the latter is implemented incorrectly.

Alternatively this could have something to do with ^ being a dead key on QWERTZ (both on Windows and Linux). The game has always been wonky about it but additionally holding Ctrl worked around the issues in the official patches as well as older codx versions.

I’ve tried various combinations of Shift/AltGr/^/+, to no avail. I even tried remapping my keyboard using map2 but it seems that I cannot fix it on my end.

My current workaround is to /reconnect after accessing the console. This closes it successfully.

Is the code public somewhere? I’m willing to to debug and submit a fix.

Cheers,
Squick

Never had a problem with opening / closing console: to close it just press the key to the left of 1 without pressing shift

but to answer your rant :grin:

If you use set sv_nosteamnames 0 in your server config then you can change your steam name to include cod4 colour codes and the colours will display in game

for example if your steam name is Squick then change it to ^2Squick and it will be green in game.

Also check your config_mp.cfg in your installation folder, something like: Activision\Call of Duty 4 - Modern Warfare\players\profiles\Player Name

for the line:

bind ` "toggleconsole"

If it is set to anything else change it.

Thanks for your reply.

I’m confident that this is a bug.


Doesn’t work for me. Hitting it once does nothing (it’s a “dead” key). Hitting it again outputs a single ^ (while on Windows it would output 2 on the second press (^^)).

That config file is not used by codx except for migration on first run. The correct location is %LocalAppdata%\CallofDuty4MW\players\profiles\<profile name>\config_mp.cfg.

I got this in my config:

bind ` "toggleconsole"
bind 0 "toggleconsole"

(added the 0 for testing)

Like I said, the game doesn’t know about toggleconsole anymore in the latest codx version (“Unknown command toggleconsole”). I suppose it’s been removed.

That’s a neat option, thanks for the tip. I’ll come back to this if I decide to run my own server.

I already changed my steam name to include the color codes right after complaining and it gets used on codx servers. :ok_hand:

Just tested, also can’t type backticks ( ` ) into either console or chat. These also act as dead keys but are even weirder to type on QWERTZ: It’s Shift + the button left to backspace.

I tried a bunch of combinations with this as well - no luck.

Forward ticks ' (same key, also dead) and apostrophes ' (different key, not dead) work as intended.

By chance I came across https://github.com/callofduty4x/CoD4x_Client_pub which seems to be an outdated partial copy of cod4x.

The commit history doesn’t mention anything related.

I spent roughly 2 hours going through the repo but couldn’t identify the code responsible for opening/closing the in-game console, only the draw logic preamble and this stuff.

Am I on the right track here? Any point in spending more time going through that codebase?

Hello Squick, let me get some facts …
You are running Linux and running cod4x through that?

Cod4x doesn’t control the keys used for console or the console itself as it is a core cod4 feature.

I am on windows using the cd version of the game and never had any issue with the console or any keys.

So could this be a problem related to Linux and maybe keyboard driver / mapping?

Or running it through Linux itself…hopefully someone who uses Linux could help you but it looks like no one else has anything to input

Cheers

MAD_DAD

Hi Squick,
I just got recently a Steam Deck (running SteamOS) and I have exactly the same issue. I think this problem is related to Wine/Proton because on my Windows System CoD4X does not have this weird problem. I am also using QWERTZ keyboard. I had some trouble with installing CoD4X on my Steam Deck because there is just a install.bat, maybe I can provide a simple install.sh which does the same copy tasks.

Let me know if you find a fix for this.

Ozzy

Yes, that’s the case. I use lutris (wine/proton/dxvk/whatnot) to run the game and rigged a run script to also start steam at the same time.

Unfortunately, but this isn’t what this post is about, steam starting up, even with a bunch of -silent etc arguments causes trouble on startup (repeated focus loss / minimizing the game) and then the intrusive thing stays in the systray until i manually quit it. Had no success to get it automatically terminated but I might mess with this some more in the future.

I also use the CD version, with a purchased key. (Copied the files and registry entries from the windows installation)

Driver issue is a possibility I guess. Keyboard mapping is correct though - I can use all the keys in other applications and they do what they are supposed to.

My bet is on dead key behavior difference between windows and linux currently.

I haven’t gotten around to this yet but I’ll try downgrade to the old cod4x version I had on windows and see if it makes a difference - next time I decide to boot the thing.


What cod4x version have you tested with on windows? The same one (21.1) that has this issue on linux?

I didn’t have any trouble installling. You can run .bat/.cmd files in wine same as .exe files:

WINEPREFIX=/path/to/prefix wine /path/to/cod4/cod4-client-manualinstall_21.1/install.cmd

I’ll report back here in any case. :+1: