- Home /
Catch Ctrl+Z input in Editor
Is it possible to catch Ctrl+Z in Editor? Something like:
`(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) && Input.GetKeyUp(KeyCode.Z)`
The keys works separately, but not together.
why did you use Get$$anonymous$$eyUp for Z ?it's Get$$anonymous$$eyDown maybe more appropriate ?
$$anonymous$$eyUp is more conventional. Just try any software - everything works on $$anonymous$$eyUp (that applies to mouse and keyboard). Of course for games $$anonymous$$eyDown makes more sense since you want faster reaction.
Wrong! Everything works on $$anonymous$$eyDown (except mouse buttons which don't support/need auto-repeat as on scrollbar arrows). That's why you can press a key and hold it ins$$anonymous$$d of pressing it multiple times.
@Flipbookee: I stand corrected :) yes, keyboard works on $$anonymous$$eyDown, mouse works on ButtonUp. I'll fix my code :)
Answer by liszto · Oct 23, 2012 at 09:21 PM
I think your solution is here :
http://answers.unity3d.com/questions/49285/how-can-i-get-a-combination-of-keys-pressed.html
That's not exactly what I was looking for - I know how to write code for the logic statement, but it doesn't work in Editor. It looks like Editor treats Ctrl+Z as special combination and never passes that to the app. They talk about it in the comments.
Yes that's why I link you this ;). I never try to implement this in editor so can't give you more advice :/ Sorry. But maybe someone else already do it :), I hope for you !
Your answer
Follow this Question
Related Questions
Only KeyPress once? 1 Answer
if-else for Input.GetKey 1 Answer
Key binding screen 0 Answers
Check the latest key pressed? 2 Answers
Keyboard input not working 3 Answers