- Home /
Numpad keys in MenuItem?
Simple question: Menu Item - how to make menu hotkeys witch Numpad keys? For example CTRL+Numpad1 instead of CTRL+1 (%1)?
Comment
When I try for example %1, and press CTR + 1 on numpad keys its doesnt work either (but works fine on "normal" 1). I guess 1 on numpad keys is not the same key as "normal" 1, but there is no way to use it? :(
Answer by Bunny83 · Mar 12, 2012 at 11:42 AM
You can't define hotkeys with numpad keys, but you can do something in OnGUI's Keydown event. Check for any key you like.
if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Keypad1)
{
//
}
Keep in mind this isn't a hotkey. This won't eat up the key press like a hotkey would.
Your answer
Follow this Question
Related Questions
MenuItem toggle getting reset on play. 0 Answers
Editor Scripting Question 1 Answer
Can I create MenuItem from code? 3 Answers