Portal 2

Portal 2

498 ratings
How to play Local Co-op with Controller + Keyboard
By Eetami
Regarding this topic information is scarce. How to play offline co-op? Pressing "X" doesn't do anything? These questions and more are answered in this guide.
In case you didn't know...

High five!

Yes, there is an offline splitscreen co-op mode in the PC version of Portal 2. To play it, all you need is a couple controllers, go Play Co-op game and press X (SQUARE on PS3 controller) on the second controller. Pictures:

Step one: Play cooperative game
Step two: Press X (SQUARE on a PS3 controller) on the controller.
You should know: Playing offline splitscreen disables achievements. The game considers it "cheating".
Pictures: Click on the images to enlarge them. Recommended for people with bad eye-sight.

Now in case you don't have multiple controllers and want to play with a friend using mouse/keyboard and a controller respectively, read on.

First up a couple notes!
- Enable controller from Options! Check that controller control is enabled.

- This guide does not cover how to play custom co-op maps in offline splitscreen mode. For that, check this link.

- This guide does also not cover how to play offline co-op with two keyboards and two mouses.

- If your controller is something other than Xbox 360 controller for Windows or Xbox One controller, and you can't get it to start offline splitscreen, check your button bindings! Some cases might require you to install 3rd party software to emulate Xbox 360 controller, MotioninJoy seems to work for most controllers.

- Some pictures have finnish text in them. Don't worry, I've translated the important stuff for you.

- The depicted method isn't supported in Linux or OS X version of Portal 2.
What to do if I have only one controller?
Upon entering co-op mode you'll notice the text "Offline splitscreen: Press X on controller 2". If you're like me, and have only one controller, pressing X does absolutely nothing. The problem is that your controller is assigned to player 1 by default. That means you can play single-player and online co-op game with both your mouse/keyboard and your controller, perhaps even at the sime time, but not offline splitscreen mode. The game doesn't know you have another player.

In order for the offline co-op mode to work you don't need elaborate config setups or 3rd party executables like JoyID, but you do need to tinker a bit...
Messing with Launch options
The fastest and probably the easiest way to map your controller 1 to player 2 is to type this to launch options:
-joy_remap_player_for_controller1 2
Below a picture:

A picture of the launch options in finnish. It says "for advanced users only", don't let it spook you.

To get to launch options press right mouse button while hovering over Portal 2 library entry, select Properties and press Set launch options. Another picture:

Finnish grammar: "Ominaisuudet" means Properties.
Developer console
You've now succesfully assigned your controller to player 2! But it also presents a problem: your controller is now always mapped to player 2: that means you now can't play single-player or online co-op with your controller (they're always played as player 1!) This is why you have to enable developer console. You can do this in-game like this:

The default key to open developer console is '~', the squiggly button next to '1' key in the US keyboard layout. However the scandinavian layout doesn't have this button, so you'll have to use other means to open it.

One way to do this is to type this to launch options:
Again a picture:

You can actually write any commands here: every subsequent command is introduced with '-'.

Now you you have the developer console visible every time you start the game and you can type in the same command:
joy_remap_player_for_controller1 2 // The number value tells the game which player is taking over the controller. 0 means default, 1 is player 1, 2 is player 2 etc.
A picture of the developer console. This is what you're looking for. Only this time you type commands without '-'.
More on developer console
There are various other ways to bring up developer console that don't require typing any launch options. Below I will depict one of them.

Creating an autoexec.cfg
otherwise known as user configuration

The most preferable way is to create a new file called autoexec.cfg in the cfg folder in your Portal 2 install directory. Here's mine:

My autoexec.cfg highlighted in the top. Take note of the directory: it's fairly similar in every Windows system. In Linux or iOS the default install directories are found in Steam Support.

To create the file you need to create a new text file like this:

Press right mouse button while in the cfg folder, left click on New ("uusi" in finnish) and press Text file (again "tekstitiedosto" in finnish).

Text files automatically have the extension .txt. Rename the file to autoexec.cfg and remove the .txt extension. Make sure your folder settings is set to show file extensions. If you rename it to anything else, it is not automatically executed! Hence the name "autoexec".

None of your text editing programs probably know how to open it, but once you double-click it select "Open with notepad". You should see a blank text file. Copy this to your autoexec.cfg:
// This automatically enables console so you don't have to con_enable 1 // These aliases create an automatic toggle for remapping your controller alias "togglecontroller" "remap1to2" alias "remap1to2" "joy_remap_player_for_controller1 2; alias togglecontroller remap2to1; echo Xbox 360 controller 1 remapped to Player 2" alias "remap2to1" "joy_remap_player_for_controller1 1; alias togglecontroller remap1to2; echo Xbox 360 controller 1 remapped to Player 1" // These aliases create an automatic toggle for remapping your keyboard alias "togglekeyboard" "sv_cheats 1; key_remap_keyboard_for_player1" alias "key_remap_keyboard_for_player1" "in_forceuser 0; alias togglekeyboard key_remap_keyboard_for_player2; echo Keyboard remapped to Player 1" alias "key_remap_keyboard_for_player2" "in_forceuser 1; alias togglekeyboard key_remap_keyboard_for_player1; echo Keyboard remapped to Player 2" // Keybindings to togglecontroller, togglekeyboard and toggleconsole bind "F9" "togglekeyboard" bind "F10" "togglecontroller" bind "F11" "toggleconsole" // The most important part host_writeconfig

It should look something like this. "Muistio" means notepad.

You're open to edit any part you deem necessary. If you don't want to bind anything to toggleconsole you can remove it, or if you don't want to bind F-keys, just type in any key you wish to bind inside the quotation marks. (The main reason for binding toggleconsole command is because the scandinavian keyboard layout doesn't have the key that is defaulted to it.)

Now click save and you're done! Once you start Portal 2 you can try out opening console with the key you just binded as well as toggling your controller remaps.

Or alternatively you can download my autoexec.cfg from this link[www.dropbox.com] and paste it to the aforementioned directory. It is identical to the one above. Disclaimer: this is a secure link to dropbox so feel not afraid.
Two players, one ... keyboard?
Appearantly it is very possible to play through co-op mode with just one keyboard. Below a direct quote from comments:
Originally posted by quaternary:
For 2 players with 1 keyboard and mouse - pop open the console, and type sv_cheats 1, press enter, BindToggle "z" in_forceuser, press enter, and then ss_map mp_coop_start. Press Z and hand off the keyboard and mouse to the other person to switch players (tedious, but the only way really). You can also use this to play co-op by yourself (FOREVER ALONE MODE!!) Sometimes this breaks the pause menu so you can't keep it open for more than 1 frame - I don't know why.

Every map is possible - but very difficult at times when two players need to do something in tandem - to complete like this. One map is way too hard, though - I think it's one of the speed gel maps. You can use noclip to complete it if you want. Open the console again, type in noclip, fly around the level, and type noclip again to fall. It helps to type bind "u" noclip so you have easy access to it. Reminder that it only works if sv_cheats is set to 1, and that will disable achievements and stats (like in the coop lobby) until you restart the game!

Note that the autoexec.cfg that you can download from my DropBox already has this functionality and keybinding...

... but thanks quoternary!
I'm running on Linux/OSX and this doesn't work?
The command "joy_remap_player_for_controller1" doesn't work on Linux or OSX. I don't know why that is, you'll have to ask people at Valve.

Though there is a way to move the keyboard + mouse to player 2:
in_forceuser 1 forces the keyboard and mouse to be played as player 2.
in_forceuser 0 resets the keyboard and mouse back to player 1.
This requires running sv_cheats 1 command first.

I can't use the emote/taunt wheel!
Currently the emote wheel does not work on Xbox controllers (360 and One) or keyboard. Furthermore, the camera can't be controlled with an Xbox controller (i.e. you cannot turn). Everything seems to work properly with the Steam Controller though.

Does this work with the Steam Controller?
After preliminary testing, I couldn't transfer the SC control over to player 2 with the method glossed in this guide.. I'll try investigating further.
I made this guide because there wasn't one already and the information across internet was hugely disappointing. If you found this guide useful or otherwise entertaining, thumbs up and high five.

If you have any questions regarding developer console or other related/unrelated, post them in the comments and I'll update the guide accordingly.

Special thanks to Suomis for further translations and tips!

< >
Eetami  [author] Mar 22 @ 10:04am 
It looks as though controller support in general got messed up at some point, as I haven't been able to play with neither the Steam Controller or the Xbox 360 controller for Windows anymore.
Yup, still not working with 1 controller & 1 keyboard/mouse. Whenever you shoot using the controller the Keyboard player switches to the controller player.

It is amazing that there is no fix for this.
patrlim Feb 25 @ 11:47am 
Now I can play coop through parsec
kot Nov 28, 2020 @ 3:49am 
Anyone managed to reset local coop progress? mine is fully unlocked, the commands work only for online coop
Sinn Jul 20, 2020 @ 3:29am 
I can switch controller to player 1 or 2, but keyboard player is stuck as player 2.
"in_forceuser 0" does nothing. I've enabled sv_cheats.
LittleNinja Jun 18, 2020 @ 2:38pm 
How do you play this in custom maps? I click the link, but what then? It brings be to the disscusion page.
Shade Meadows May 1, 2020 @ 8:09am 
Thanks a lot!
I can finally play it with my sister! ;D
thewilq Apr 12, 2020 @ 4:27am 
Maybe it is going to help somoene:

My situation - two logitech f710 gamepads
I wanted to play split screen, and only one controller worked in game, both in menu. So I was able to use keaboard+mouse and gamepad1 to control player one, gamepad2 did not work for player2.
I tried everything in several guides, configs, remaps, commands.

What worked instantly with no additional steps was:
Game properties -> General -> Steam Input Per-Game Setting -> Forced ON

Restert the game.
Go into split screen, and voila without doing anything it suddenly WORKS!

Good luck everyone!
Cyber Pants Apr 5, 2020 @ 3:07am 
:steamhappy: https://store.steampowered.com/news/56268/ :

Product Update - Valve
An update has been released for Portal 2

- Add local coop support for one controller player and one Mouse/Keyboard player.
apeaxlp Mar 28, 2020 @ 10:45am