No keyboard input in Unity3D game builds - keyboard

I'm using Unity3D and I'm having issues with the keyboard when I 'build' the project.
When I run the game within the Unity Editor, the input works fine. However, when I build the project and test it, I have no directional input whatsoever. The mouse works fine, the game registers keystrokes (the Esc key works), but the player won't move.
I'm using Input.GetAxisRaw("Vertical") and Input.GetAxisRaw("Horizontal")
I researched the issue on the web, but I'm still stucked. The only solution I found (in various links) mentions a problem with DirectInput and states that you should remove the key "Input" from [HKEY_CURRENT_USER\Software\Unity\Player], in the Windows registry, but that doesn't seem to work for me.
Has anybody else fought this problem? Any working solutions? Am I doing the registry trick wrong?

You should check out Input Manager in Edit->Project Settings-> Input. Have you tried using GetAxis instead of GetAxisRaw? I also suggest using, eg: Input.GetKey(KeyCode.A) and etc.

I've figured out what was troubling me.
Input.GetAxisRaw("Vertical") and Input.GetAxisRaw("Horizontal") were fine the whole time. Somehow, there was some code in the script that in the Editor worked just fine, but when running as standalone gave me a calculation equal to 0 (it depends on the Delta Time, so I assume that the Delta Time when running compiled is much smaller than when running in the Unity Editor) and thus the character didn't move at all.

Related

The Godot Engine Editor's IDE/GUI seems to be slow and to ignore mouse interaction

I'm using Godot_v3.2.1-stable_win64.exe(current Godot version) on my Windows 10. When running a project everything seems to work fine but when using the actual IDE of the Godot engine it seems like the IDE screen doesn't update fluidly on every mouse interaction but like only every 5 seconds instead (as like FPS would be low).
So mostly on hovering or clicking something it would light up or be triggered after you clicked on some other thing elsewhere (which is stupid of course).
This makes it even impossible to hit a button sometimes in the IDE.
E.g. when renaming a file a Window/Box for renaming pops up but you do not see it, because the IDE screen isn't updated. So if you don't blindly click on the box (which you don't see) the option for renaming is lost, because the box closes when clicking anywhere else. See what I mean?
Thank you for listening. Have a great day.
This is a known issue. Try updating your graphics driver to the latest version provided by Intel (not your OEM).

itcl tabnotebook missing tabs on Windows

I have a itcl/tk application that runs fine on Linux (and for the most part on Windows too). Have a frame where I packed an iwidgets::scrolledframe and within that an iwidgets::tabnotebook where two tabs were added.
Never have a problem on Linux, but on Windows (using Win7) often the 2nd tab is missing. Sometimes exiting and reinvoking the application on Windows and it will appear, but often it just never does. I have tried reorganizing code, inserted "update idletasks", to no avail.
Not sure if there are other tricks, or need to dig into itcl/tk installed code, or if could be a potentially a PC machine hardware issue.
Any ideas or suggestions of things to try will be graciously appreciated.
Turns out I appeared to resolve this via a strategically place update idletasks afterall. ;)

Eclipse: some keyboard's key suddenly stop working

I feel the need to understand why, while I'm working in eclipse, some keys stop working, especially backspace and del keys.
I have searched on the net and found that it is recognized as a bug: I often read that the problem is related to other applications.
So the best advice is to restart Eckipse. (???)
Someone should explain to the Eclipse's developers that it cannot stop working (or working bad) if some other application stops working or crashes.
ps. Now I'm working in Ubuntu, but I see that the problem is platform-independent.
If you use many keyboard layouts, you may have accidentally changed them by pressing alt+shift. If that's the case, pressing it again will restore it to the normal layout.

Python IDLE GUI not starting

I feel like I have been coming the internet for days with absolutely no result.
I have taken some web programming classes, and would like to learn some python, just because programming is wicked interesting altogether, and have run into a fairly large hurdle given my experience.
the problem is this: Python.exe (or is is more properly pythonw.exe?) v3.3.3, running on windows 8.1 used to launch fine. Typed up a simple program to roll various sided die, worked out well. Then I changed the key bindings for 'Run Module' from 'ctrl+f5' to 'crtl+alt+spacebar.'
As soon as I did this IDLE crashed and so did the shell. Now the process will not run AT ALL. I cannot access it through the desktop icon to go back and revert the settings. I also attempted to look at the .def files and change it from there but could not find the 'run module' command. It looked like all the key bindings in the .def files were for the shell.
When I double click, nothing, when I run as admin, nothing. run from the start menu, nothing. I uninstalled and re-installed, rebooted, everything low tech I can think of. Now i'm out of my element and could use one of you brilliant social programmers!!
I've found information about checking with some tool called 'Windows Process Manager' some stuff about what to do with the CMD prompt (something about a path problem ...it intuitivly sounds like I very well could have created a 'path problem' but I'm not 100% I know what that is exactly).
I'm sorry for the lack of links, the pages were farther back in my browsing history than I expected. Hopefully i'm not asking an instant many down vote question here, most of the resources online are for either an older version of windows, Lunix, or an older version of python (which is actually where the path problem hint came from)
Thanks any and all greatly for any time spend reading/answering.
Immensely appreciated.
Find file HOME/.idlerc/config-keys.cfg, where on Win7 HOME would be 'C:/Users/yourloginname', and delete the key binding or, if there is nothing else in the file or nothing you want to keep, the whole file.
If you were to run Idle from a console with python -m idlelib, you would probably see an error message. (Yes, you were probably running with pythonw, as when using the start menu or icon. This works better in 3.4.2 and I am working or more improvements.)
I do not know the specific reason for your crash. I set Zoom-height to --space, restarted, and it works, no problem.

Screen capture doesn't work on MFC application in Vista

We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to find a way to make them work on Vista.
In three of our applications, everything works. In the remaining one, I can get the window border, title bar, menus, and task bar, but the interior never shows up. As I said, these applications use the exact same code to write to the screen and capture the window image, and the only difference I see that looks like it might be relevant is that the problem application uses the MFC multiple document interface, while the ones that work use the single document interface.
Either the answer isn't on the net, or I'm worse at Googling than I thought. I asked on the MSDN forums, and the only practical suggestion I got was to use GDI+ rather than GDI, and that did nothing different. I have tried different things with every part of the code that captures and prints or save, given a pointer to the window, so apparently it's a matter of the window itself. I haven't rebuilt the offending application using SDI yet, and I really don't have any other ideas.
Has anybody seen anything like this?
What I've got is four applications. They use a lot of common code, and share the actual .h and .cpp files, so I know the drawing and screen capture code is identical.
There is a WindowtoDIB() routine that takes a *pWnd, and a source rectangle and destination size. It looks like very slightly adapted Microsoft code, and I've found other functions in this file on the Microsoft website. Of my four applications, three handle this just fine, but one doesn't. The most obvious difference is that the problem one is MDI.
It looks to me like the *pWnd is the problem. I'm not a MFC guru by a long shot, and it seems to me that the problem may be that we've got one window setup in the SDIs, and more than one in the MDI. I may be passing the wrong *pWnd to the function.
In the meantime, it has started working properly on the 64-bit Vista test machine, although it still doesn't work on the 32-bit Vista machine. I have no idea why. I haven't changed anything since the last tests, and I didn't think anybody else had. (On the 32-bit version, the Print Screen key works as expected, but it does not save the screen as a JPEG.)
Your question title mentions screen capture but your actual question doesn't. Please elaborate more clearly. Is the problem that you can do screen capture of three of your applications, but not the fourth one? You can use different screen capture software that can capture OpenGL/DirectX windows. Those surfaces are handled directly by the Window Manager and won't show up with a simple 'PrtScn'.
Switching to GDI+ won't solve it, nor will switching to SDI.
If it's the content of the CView that you want, then yes, that should be right one. If it's the content of the whole screen (at least the content, without the toolbar(s) and status bar), then you should pass it the CMainFrame (that's the default name which may have been changed, the one that is derived from CMDIFrameWnd).
Can you post the code of WindowToDIB()? I've just tried it and It Works For Me (TM), but without OpenGL code in the view. Try passing the following windows to your WindowToDIB() function:
CMainFrame* mainfrm = static_cast<CMainFrame*>(::AfxGetMainWnd());
- mainfrm
- mainfrm->MDIGetActive()
- mainfrm->MDIGetActive()->GetActiveView()
and see what you get.
The contents of each window are directX surfaces and are only assembled by the window manager in the graphics card. You'd not be able to capture this unless you switch off the new interface (DWM) or code specifically for screen capture from the DWM.
Wikipedia has a good description of the Desktop Window Manager (DWM)
Sorry, I still don't understand. You're trying to get the Print Screen key to work on all four applications? Or you're trying to get the WindowtoDIB() function to work, which takes a 'screenshot' (from within your own application) of the application itself, so that it can be saved as an image file?
Also, what do you mean with 'he Print Screen key works as expected, but it does not save the screen as a JPEG.'? Print Screen only copies to the clipboard, what happens when you paste in Paint?
If your WindowtoDIB() function only 'captures' the window you pass to it, then yes, your MDI child windows are not going to show up.
We eventually solved this by creating a different OpenGL context, and drawing everything to that. We gave up on the screen capture.

Resources