Left Mouse doesn't register click when keyboard button is pressed
My game doesn't register the left mouse button being clicked down using Input.GetMouseButtonDown when any key on the keyboard is held down regardless of whether the key does anything. The right mouse button doesn't have any such trouble. I've isolated the button from all other variables and even tested it in other scripts but the outcome is the same. The button only fires when no key has been held down on the keyboard for a second or two. Ive tried searching the entire project and there doesnt appear to be anything else acting on the mouse button. Does anyone know what could cause this?
Thanks.
I just created a test project, with a single object that displays the results of Input.Get$$anonymous$$ouseButton(). I didn't get the same results as you. Perhaps it's a system issue? I'm using a pc- no macros enabled. Another thought, perhaps you are not ACTUALLY checking the mouse when you are holding down a key? a Debug.log showing BOTH a true and false result from your Input.Get$$anonymous$$ouseButton(), would confirm/refute that.
I think it had something to do with my laptop. I moved my project over to my desktop and it worked right away without changing anything. Not sure what's up with my laptop but that's a completely different problem. Thanks though.
got exactly the same problem... after reading this tested with the right mouse button - that one works fine...
Answer by rakatan · Jan 02, 2018 at 08:53 PM
apparently it was windows - see https://superuser.com/questions/658095/using-keyboard-disables-touchpad-left-button-for-a-second-on-acer-laptop-in-wind
especially this part:
On my Windows 10 laptop, the proper setting to allow simultaneous use of the keyboard and the touchpad's left mouse button is:
Settings > Devices > Touchpad (left nav) > Touchpad Sensitivity (dropdown) > Most Sensitive
On Windows 8.1 this was found at: PC and devices > $$anonymous$$ouse and touchpad > "Touchpad" section Under explanation: "To help prevent the cursor from accidentally moving while you type, change the delay before clicks work." (dropdown) > No delay (always on)