Keyboard unresponsive IN NEW PROJECTS! Mouse works. Registry problems? PlayerPrefs.DeleteAll()?

I used PlayerPrefs.DeleteAll() in one of my projects (well, my main project), and now the keyboard (and my PS3 controller that my computer thinks is a 360 controller) won’t work IN ANY PROJECT. This only happens with my own projects when using the Play button in the Editor.

The mouse still works.
Using Build and Run still works.
Other projects (not built by me, such as the Standard Assets Example Project) still work.

At some point, I got a couple prefab character controllers to work, but then after quitting and restarting Unity and loading the scene again, they stopped working. (I don’t know how to reproduce this, as currently anything I do doesn’t seem to work.)

My InputManager is set like this:

When I run this code, I get a console message, “True”, whenever I click. But when I press the Space Bar, I get nothing.

void Update ()
{
    if (Input.GetButtonDown("Fire1"))
    {
         print (true);
    }
}

I’ve heard it could be a Registry issue. I have no idea how to fix a Registry issue, so I seriously need some help before I can even work on any projects.

I’ve heard this particular entry causes problems. I don’t see it where it’s supposed to be, and I haven’t tried to change it manually, though PlayerPrefs.DeleteAll() could have erased it when I actually need it:

[HKEY_CURRENT_USER\Software\Unity\UnityEditor]
"Input"=-

Does anyone know what this does? Should I attempt to add this to the Registry? (And if so, how to?) Can anyone help me restore the Registry to factory conditions? I’m going to try to reinstall everything, but that still seems like the wrong solution. I should be able to use PlayerPrefs.DeleteAll() without having to reinstall Unity just to make games work again… (And I have a bad feeling it work work…)

Someone please help. This is problem is making me crazy…

Edit: Reinstalling didn’t work.

I’m gonna bump this a lot… Hope that’s okay.

Bump. Also, after reinstalling, the newest Standard Assets Example Project doesn’t work using the Play button. However, the older one left over from the old install DOES still work using the Play button. I’m baffled.

Bump.

Does the check for a key with Input.GetKey work?

No, it doesn’t. It only works when using Build and Run.

So I got a reply from Unity Support, and it’s clear they have no idea they’re talking about… I really need some help with this…

Would it be worth it to pay for Unity Premium Support? I really need to find a solution to this problem…

Another update: So I decided to try just working on my project using Build and Run, so I started up Unity, and then upgraded my Unity 4 project to Unity 5 (after making a backup). I used Build and Run, and it worked like expected, but I noticed that the camera control stick was set incorrectly (down was up, up was down). I figured I just had the Input Manager messed up or something, either from the upgrade, or from when I tried removing it and having Unity create a new one. Either way, I had closed the game, and then just to check the camera one more time before poking around elsewhere, I hit Play before I knew what I was doing, and it worked! I was actually moving the control stick around to test the camera before I realized I was in Play mode.

Anyway, so I closed Unity so I could try adding an older backup of the Input Manager, started it up again, and it stopped working again. Now, at first, this could be taken to mean that it must be the Input Manager, right? However, I’ve previously had cases where I’d have a scene in Unity that would work fine in Play mode at first, but as soon as I closed Unity and opened it again, it stopped working. I think it has something to do with not having Input settings be set correctly when you load a scene, or something.

I’m going to try upgrading my project again from the backup I made and seeing if Play mode works. I’ll edit this message with the results.

Edit: Yep. Exactly as I suspected. It works when I upgrade it and hit Play right away, but as soon as I close Unity and start it again, it doesn’t work.

Edit2: After upgrading it again, it DOES work in Play mode. I can even load other scenes in my project and use them just fine (including a LoadLevel function to jump to another scene). But again, as soon as I close and restart Unity, the keyboard and controller stop working (but the mouse still works). What the hell, man???

(Oh, also, the whole thing about the control stick not being set properly: I just needed to invert the axis. And Build and Run still works.)

Edit3: I thought I’d be more specific about what happened when I used PlayerPrefs.DeleteAll(). Basically, I was testing my project, moving around normally, and then I touched a power-up that called the function. As soon as I did, the controls became unresponsive. I then stopped Play mode and clicked Play again, and the controls continued to not function. I then tried restarting Unity, and it’s continued the way I’ve explained above.

Just trying to throw out every piece of information I can so that maybe someone will figure out what’s wrong…

I am having a very similar issue, but without ever running PlayerPrefs.DeleteAll()
I have crossposted this to “answers” but it still (9hours later) it is at moderator approval - probably since I am a new member.

Working in Windows 8.1 and unity 5, I did the “rollerball” tutorial, Spaceshooter tutorial (in one go; that might be important) but my first playtest of the “survival shooter” totrial had no functional keyboard input.

I then reloaded the perferctly okay spaceshooter project to resuse some of the code - and keyboard controls are not functioning. However; as mentioned above: I can build the the game with keyboard controls work that work.
Rollerball is still working fine, but that as that were started from scratch it contains no upgraded assets. Maybe a clue to what that is going on?
But; perhaps the worst part; this behavour is now also present in my new projects. I have a new project that only contains one scene and has the following code attached to the camera:

voidUpdate()
{
if(Input.GetKeyDown(KeyCode.Y))
{
Debug.Log("Button press is working");
}
if(Input.GetButton("Fire1"))
{
Debug.Log("Mouce click is working");
}
}

(formatting got butchered by copy/paste, sorry)

Only mouseclicks are registered. Keyboard does nothing.

The (possible) import/upgrade relation mentioned above is new to me, so I’ll look into that and see if I can reproduce a behavour.

Incase google ever brings someone across this same issue (but due to the lack of relevant information on google, my guess is that it is a rare one); I have, by chance, found a workaround.

I decided to carry on with the Survival shooter tutorial and the character was turning oddly; The solution, as posted in a youtube comment, is to use the “maximize on play”.

And; when running as maximized keyboard input also works!

So, the issue still remains; the keyboard always work with Rollerball and standard assets, but my new projects and imported/upgraded projects must run maximized to work correcty.

It’s a workaround I can live with. Perhaps the issue will go away as sudden as it appeared.

Sorry for getting back so late. Your workaround does work for me, and along with being able to readjust the layout after maximize on play, it seems I can still basically use the inspector while playing. It’s so… clunky, though… x_x

I’m so glad someone else had this problem, though. Thanks for your help.

It worries me to not see an answer to this. I am using 5.3.1f1 right now and came back after a weekend and my unity no longer registers keyboard presses I have a keyboard plugged into a laptop and neither is noticed in play mode. Mouse is noticed for an actual mouse and the laptop pad click though. I have made a new project with a simple little script just checking for key presses and still nothing. I have reinstalled and still have the issue. I cannot even get it to notice in the maximize on play workaround others have mentioned. Any assistance would be appreciated.

Hi all,
I had the same problem (and it was killing me). In my case switching “maximize on play” didn’t work, but changing layouts did!! Even when changed back to previous one afterwards!

My eventual solution to this was to make another account on the computer and that worked. Not a nice solution but just throwing that out there.

Are you having multiple “Game” tabs? If so, did you select the “right one” before trying to move around?

1 Like

“Are you having multiple “Game” tabs? If so, did you select the “right one” before trying to move around?”

  • Snowurm

I have tried:

  • Validating my project input settings (if in doubt, reset)

  • Edit → Project Settings → Input

  • Someone elsewhere mentioned checking editor settings

  • Edit → Project Settings → Editor

  • Changed to “Local” from “Remote”

  • Edit registry

  • Couldn’t find an “input” entry in my registry (Win10)

  • Snowrums suggestion of ensuring only 1 x “Game” tab

  • At this point I was able to detect keyboard input

  • I wasn’t testing this methodically so your mileage may vary

Tried adding another game tab back in - to re-create the issue, but I wasn’t able to do so.
Just seems to be working now.
shrug.

You know you’re having an underwhelming evening when you can’t even get a keypress to register lol.

1 Like

This turned out to be exactly my solution. I had two Game Windows (tabs) set for a multi display game I was working on and when I changed my mind and removed one of the displays (from the secondary Camera). I didn’t remove the second Game Window and both were rendering Display 1. Having the wrong Game Window selected kills any Input.AnyKey or an other input. I can reproduce this with some ease - but don’t want to. As it has taken me half a day to find the issue. It didn’t help that the second Game Window as hiding behind the other one (on a separate display). Only found it when I came across Snowurm’s suggestion.

Hopefully this helps more detailed explanation helps someone in the future.