summaryrefslogtreecommitdiff
path: root/Runtime/Export/EventBindings.txt
blob: fe49b68f939f0decde0599c84712c4c568ea7955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
C++RAW

#include "UnityPrefix.h"
#include "Runtime/IMGUI/IMGUIUtils.h"
#include "Runtime/Scripting/ScriptingUtility.h"
#include "Runtime/Scripting/ScriptingObjectWithIntPtrField.h"

/*
   Mono defines a bool as either 1 or 2 bytes.
   On windows a bool on the C++ side needs to be 2 bytes.
   We use the typemap to map bool's to short's.
   When using the C++ keyword and you want to export a bool value 
   to mono you have to use a short on the C++ side.
*/


void PauseEditor ();
using namespace std;

CSRAW
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections;

namespace UnityEngine
{

C++RAW
 static void CleanupInputEvent(void* inputEvent){ delete (InputEvent*)inputEvent; };

// A UnityGUI event.
CSRAW [StructLayout (LayoutKind.Sequential)]
CLASS Event

CSRAW
	// *undocumented
	public Event () {
		Init ();
	}
	THREAD_SAFE
	CUSTOM private void Init () {
		InputEvent* newEvent = new InputEvent ();
		self.SetPtr(newEvent,CleanupInputEvent);
		newEvent->Init();
	}

	// Copy an event
	CSRAW public Event (Event other) {
		if (other == null)
			throw new ArgumentException ("Event to copy from is null.");
		InitCopy (other);
	}
	
	// *undocumented
	CSRAW private Event (IntPtr ptr) {
		InitPtr (ptr);
	}
	
	// *undocumented
	CSRAW ~Event () {
		Cleanup ();
	}
	THREAD_SAFE
	CUSTOM private void Cleanup () {
		CleanupInputEvent(self.GetPtr());
	}	
	
	THREAD_SAFE
	CUSTOM private void InitCopy (Event other) 
	{
		self.SetPtr(new InputEvent (*other), CleanupInputEvent);
	}
	
	THREAD_SAFE
	CUSTOM private void InitPtr (IntPtr ptr) 
	{
		self.SetPtr((InputEvent*)ptr, CleanupInputEvent);
	}

	
CSRAW
	[System.NonSerialized] [NotRenamed]
	internal IntPtr m_Ptr;	
	
	CUSTOM_PROP EventType rawType 
		{ return self->type; }
	
	// The type of event. 
	CUSTOM_PROP EventType type
		{ return IMGUI::GetEventType (GetGUIState(), *self); }
		{ self->type = value; }
	
	CUSTOM EventType GetTypeForControl (int controlID) 
		{ return IMGUI::GetEventTypeForControl (GetGUIState(), *self, controlID); }
	

	/// Information about the current mouse or touch event, available during On*Event series of callbacks.
	CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
	CUSTOM_PROP	Touch touch { return self->touch; }
	
	// The mouse position.
	CSRAW public Vector2   mousePosition { get {
			Vector2 tmp; Internal_GetMousePosition(out tmp); return tmp; } 
		set { Internal_SetMousePosition (value); }
	}
	CUSTOM private void Internal_SetMousePosition (Vector2 value)
	{
#if ENABLE_NEW_EVENT_SYSTEM
		self->touch.pos = value;
#else
		self->mousePosition = value;
#endif
	}
	CUSTOM private void Internal_GetMousePosition (out Vector2 value)
	{
#if ENABLE_NEW_EVENT_SYSTEM
		*value = self->touch.pos;
#else
		*value = self->mousePosition;
#endif
	}


	// The relative movement of the mouse compared to last event.
	CSRAW public Vector2 delta { get {
			Vector2 tmp; Internal_GetMouseDelta(out tmp); return tmp; } 
		set { Internal_SetMouseDelta (value); }
	}
	CUSTOM private void Internal_SetMouseDelta (Vector2 value)
	{
#if ENABLE_NEW_EVENT_SYSTEM
		self->touch.deltaPos = value;
#else
		self->delta = value;
#endif
	}
	CUSTOM private void Internal_GetMouseDelta (out Vector2 value)
	{
#if ENABLE_NEW_EVENT_SYSTEM
		*value = self->touch.deltaPos;
#else
		*value = self->delta;
#endif
	}
	
	OBSOLETE error Use HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
	CSRAW public Ray mouseRay { get { return new Ray (Vector3.up, Vector3.up); } set {  }}
	
	// Which mouse button was pressed.
	CUSTOM_PROP int button 
		{ return self->button; }
		{ self->button = value; }
	
	// Which modifier keys are held down.
	CUSTOM_PROP EventModifiers modifiers 
		{ return self->modifiers; }
		{ self->modifiers = value; }
	
	// *undocumented* 
	CUSTOM_PROP float pressure 
		{ return self->pressure; }
		{ self->pressure = value; }

	// How many consecutive mouse clicks have we received.
	// Detects consecutive clicks and prints them.
	//
	CUSTOM_PROP int clickCount 
		{ return self->clickCount; }
		{ self->clickCount = value; }
	
	// The character typed.
	// Detects characters pressed and prints them.
	//
	CUSTOM_PROP char character
		{ return self->character; }
		{ self->character = value; }
	
	// The name of an ExecuteCommand or ValidateCommand Event
	CUSTOM_PROP string commandName
		{
			char* commandString = self->commandString;
			return scripting_string_new(commandString == NULL ? "" : commandString);
		}
		{ 
#if ENABLE_MONO		
			char* oldPtr = reinterpret_cast<char*>(self->commandString);
			delete[] oldPtr;
			char *str = mono_string_to_utf8 (value.str);
			self->commandString = new char[strlen (str) + 1];
			strcpy (self->commandString, str);
#endif					
		}

	// The raw key code for keyboard events.
	CUSTOM_PROP KeyCode keyCode
		{ return self->keycode; }
		{ self->keycode = value; }

	// Is Shift held down? (RO)
	CSRAW public bool shift { get {
			return (modifiers & EventModifiers.Shift)  != 0; }  
		set { if (!value) modifiers &= ~EventModifiers.Shift; else modifiers |= EventModifiers.Shift; } 
	}
		
	// Is Control key held down? (RO)
	CSRAW public bool control { get {
			return (modifiers & EventModifiers.Control)  != 0; } 
		set { if (!value) modifiers &= ~EventModifiers.Control; else modifiers |= EventModifiers.Control; } 
	}

	// Is Alt/Option key held down? (RO)
	CSRAW public bool alt { get {
			return (modifiers & EventModifiers.Alt)  != 0; } 
		set { if (!value) modifiers &= ~EventModifiers.Alt; else modifiers |= EventModifiers.Alt; } }


	// Is Command/Windows key held down? (RO)
	CSRAW public bool command { get {
			return (modifiers & EventModifiers.Command)  != 0; } 
		set { if (!value) modifiers &= ~EventModifiers.Command; else modifiers |= EventModifiers.Command; } 
	}

	// Is Caps Lock on? (RO)
	CSRAW public bool capsLock { get {
			return (modifiers & EventModifiers.CapsLock)  != 0; } 
		set { if (!value) modifiers &= ~EventModifiers.CapsLock; else modifiers |= EventModifiers.CapsLock; } 
	}

	// Is the current keypress on the numeric keyboard? (RO)
	CSRAW public bool numeric { get {
			return (modifiers & EventModifiers.Numeric)  != 0; } 
		set { if (!value) modifiers &= ~EventModifiers.Shift; else modifiers |= EventModifiers.Shift; } 
	}

	// Is the current keypress a function key? (RO)
	CSRAW public bool functionKey { get { return (modifiers & EventModifiers.FunctionKey)  != 0; } }

	// The current event that's being processed right now.
	// TODO: set this to null outside the event loop.
	//
	CSRAW public static Event current { get { 
			// return null if Event.current is queried outside OnGUI
			// Only in editor because of backwards compat.
			#if UNITY_EDITOR
				if (GUIUtility.Internal_GetGUIDepth () > 0)
					return s_Current;
				else
					return null;
			#else
				return s_Current; 
			#endif
		}
		set 
		{ 
			if (value != null) 
				s_Current = value; 
			else 
				s_Current = s_MasterEvent; 
			Internal_SetNativeEvent (s_Current.m_Ptr);
		}
	}
	CSRAW static Event s_Current;
	CSRAW static Event s_MasterEvent;

	CUSTOM static private void Internal_SetNativeEvent (IntPtr ptr)
	{
		GetGUIState().Internal_SetManagedEvent (ptr);
	} 

	CSRAW static private void Internal_MakeMasterEventCurrent ()
	{
		if (s_MasterEvent == null)
			s_MasterEvent = new Event ();
		s_Current = s_MasterEvent;
		Internal_SetNativeEvent (s_MasterEvent.m_Ptr);
	}

	// Use this event.
	CUSTOM void Use () { self->Use(); }

	// Is this event a keyboard event? (RO)
	CSRAW public bool isKey { get {
		EventType t = type; return t == EventType.KeyDown || t == EventType.KeyUp; } 
	}

	// Is this event a mouse event? (RO)
	CSRAW public bool isMouse { get {
		EventType t = type; return t == EventType.MouseMove || t == EventType.MouseDown  || t == EventType.MouseUp || t == EventType.MouseDrag; } 
	}
	
	// Create a keyboard event.
	CSRAW public static Event KeyboardEvent (string key) {
		Event evt = new Event ();
		evt.type = EventType.KeyDown;
		// Can't use string.IsNullOrEmpty because it's not supported in NET 1.1
		if (key == null || key == String.Empty)
			return evt;			
		int startIdx = 0;
		bool found = false;
		do { 
			found = true;
			if (startIdx >= key.Length)
				{ found = false; break; }
			switch (key[startIdx]) {
			case '&': // Alt
				evt.modifiers |= EventModifiers.Alt; startIdx++;
				break;
			case '^': // Ctrl
				evt.modifiers |= EventModifiers.Control; startIdx++;
				break;
			case '%':
				evt.modifiers |= EventModifiers.Command; startIdx++;
				break;
			case '#':
				evt.modifiers |= EventModifiers.Shift; startIdx++;
				break;
			default: 
				found = false;
				break;
			}
		} while (found);
		string subStr = key.Substring (startIdx, key.Length - startIdx).ToLower();
		switch (subStr) {
			case "[0]":  		evt.character = '0'; evt.keyCode = KeyCode.Keypad0; break;
			case "[1]":  		evt.character = '1'; evt.keyCode = KeyCode.Keypad1; break;
			case "[2]":  		evt.character = '2'; evt.keyCode = KeyCode.Keypad2; break;
			case "[3]":  		evt.character = '3'; evt.keyCode = KeyCode.Keypad3; break;
			case "[4]":  		evt.character = '4'; evt.keyCode = KeyCode.Keypad4; break;
			case "[5]":  		evt.character = '5'; evt.keyCode = KeyCode.Keypad5; break;
			case "[6]":  		evt.character = '6'; evt.keyCode = KeyCode.Keypad6; break;
			case "[7]":  		evt.character = '7'; evt.keyCode = KeyCode.Keypad7; break;
			case "[8]":  		evt.character = '8'; evt.keyCode = KeyCode.Keypad8; break;
			case "[9]":  		evt.character = '9'; evt.keyCode = KeyCode.Keypad9; break;
			case "[.]":			evt.character = '.'; evt.keyCode = KeyCode.KeypadPeriod; break;
			case "[/]":			evt.character = '/'; evt.keyCode = KeyCode.KeypadDivide; break;
			case "[-]":  		evt.character = '-'; evt.keyCode = KeyCode.KeypadMinus; break;
			case "[+]":  		evt.character = '+'; evt.keyCode = KeyCode.KeypadPlus; break;
			case "[=]":  		evt.character = '='; evt.keyCode = KeyCode.KeypadEquals; break;
			case "[equals]":  	evt.character = '='; evt.keyCode = KeyCode.KeypadEquals; break;
			case "[enter]":		evt.character = '\n'; evt.keyCode = KeyCode.KeypadEnter; break;
			case "up": 		/*evt.character = (char)63232; */evt.keyCode = KeyCode.UpArrow; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "down":	  	/*evt.character = (char)63233; */evt.keyCode = KeyCode.DownArrow; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "left": 		/*evt.character = (char)63234; */evt.keyCode = KeyCode.LeftArrow; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "right":	  	/*evt.character = (char)63235; */evt.keyCode = KeyCode.RightArrow; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "insert": 		evt.keyCode = KeyCode.Insert; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "home":	  	/*evt.character = (char)63273;	*/evt.keyCode = KeyCode.Home; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "end": 		/*evt.character = (char)63275;	*/evt.keyCode = KeyCode.End; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "pgup":	  	/*evt.character = (char)63276;	*/evt.keyCode = KeyCode.PageDown; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "page up":	/*evt.character = (char)63276;	*/evt.keyCode = KeyCode.PageUp; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "pgdown":	/*evt.character = (char)63277;	*/evt.keyCode = KeyCode.PageUp; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "page down":	/*evt.character = (char)63277;	*/evt.keyCode = KeyCode.PageDown; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "backspace":	/*evt.character = (char)127;	*/evt.keyCode = KeyCode.Backspace; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "delete":	  	/*evt.character = (char)63272;	*/evt.keyCode = KeyCode.Delete; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "tab":		/*evt.character = (char)9;		*/evt.keyCode = KeyCode.Tab; break;
			case "f1": 		 	/*evt.character = (char)63236; */evt.keyCode = KeyCode.F1; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f2": 		 	/*evt.character = (char)63237; */evt.keyCode = KeyCode.F2; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f3": 		 	/*evt.character = (char)63238; */evt.keyCode = KeyCode.F3; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f4": 		 	/*evt.character = (char)63239; */evt.keyCode = KeyCode.F4; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f5": 		 	/*evt.character = (char)63240; */evt.keyCode = KeyCode.F5; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f6": 		 	/*evt.character = (char)63241; */evt.keyCode = KeyCode.F6; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f7": 		 	/*evt.character = (char)63242; */evt.keyCode = KeyCode.F7; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f8": 		 	/*evt.character = (char)63243; */evt.keyCode = KeyCode.F8; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f9": 		 	/*evt.character = (char)63244; */evt.keyCode = KeyCode.F9; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f10": 		/*evt.character = (char)63245; */evt.keyCode = KeyCode.F10; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f11": 		/*evt.character = (char)63246; */evt.keyCode = KeyCode.F11; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f12": 		/*evt.character = (char)63247; */evt.keyCode = KeyCode.F12; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f13": 		/*evt.character = (char)63248; */evt.keyCode = KeyCode.F13; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f14": 		/*evt.character = (char)63249; */evt.keyCode = KeyCode.F14; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "f15": 		/*evt.character = (char)63250; */evt.keyCode = KeyCode.F15; evt.modifiers |= EventModifiers.FunctionKey; break;
			case "[esc]":		evt.keyCode = KeyCode.Escape; break;
			case "return":		evt.character = '\n'; evt.keyCode = KeyCode.Return; evt.modifiers &= ~EventModifiers.FunctionKey; break;
			case "space":		evt.keyCode = KeyCode.Space; evt.character = ' '; evt.modifiers &= ~EventModifiers.FunctionKey; break;
			default:
				if (subStr.Length != 1)
				{
					// soren: try this first
					try {
						evt.keyCode = (KeyCode)Enum.Parse(typeof(KeyCode), subStr, true);
					}
					catch (ArgumentException)
					{
						Debug.LogError (UnityString.Format ("Unable to find key name that matches '{0}'", subStr));
					}
				}
				else
				{
					evt.character = subStr.ToLower()[0]; 
					evt.keyCode = (KeyCode)evt.character;
					if ((int)evt.modifiers != 0)
						evt.character = (char)0;
				}
				break;
		}
		return evt;
	}
		
	// Calculate the hash code
	CSRAW public override int GetHashCode( ) {
		int hc = 1;
		if (isKey) 
			hc =  (ushort)keyCode;
		if (isMouse) 
			hc = mousePosition.GetHashCode ();
		hc = hc*37 | (int)modifiers;
//		Debug.Log (hc + "  GetHashCode of " + ToString());
		return hc;
	}


	CSRAW public override bool Equals (object obj) {
		if (obj == null)
			return false;
		if (Object.ReferenceEquals (this, obj))
			return true;
		if (obj.GetType () != GetType())
			return false;


		Event rhs = (Event)obj;
		if (type != rhs.type || modifiers != rhs.modifiers)
			return false;
		if (isKey)
			return keyCode == rhs.keyCode && modifiers == rhs.modifiers;
		if (isMouse)
			return mousePosition == rhs.mousePosition;
		return false;
	}
	
	
	
	CSRAW public override string ToString( )
	{
		if (isKey) {
			if ((int)character == 0) 
				return UnityString.Format ("Event:{0}   Character:\\0   Modifiers:{1}   KeyCode:{2}", type, modifiers, keyCode);
			else {
				return UnityString.Format ("Event:" +type + "   Character:" + (int)(character) + "   Modifiers:" + modifiers + "   KeyCode:" + keyCode);
			}
		}
		if (isMouse) 
			return UnityString.Format ("Event: {0}   Position: {1} Modifiers: {2}", type, mousePosition, modifiers);

		if (type == EventType.ExecuteCommand || type == EventType.ValidateCommand)
			return UnityString.Format ("Event: {0}  \"{1}\"", type, commandName);

		return "" + type;
	}
C++RAW


END


// Key codes returned by Event.keyCode. These map directly to a physical key on the keyboard.
ENUM KeyCode
	// Not assigned (never returned as the result of a keystroke)
	None = 0,
	// The backspace key
	Backspace		= 8,
	// The forward delete key
	Delete		= 127,
	// The tab key
	Tab		= 9,
	// The Clear key
	Clear		= 12,
	// Return key
	Return		= 13,
	// Pause on PC machines
	Pause		= 19,
	// Escape key
	Escape		= 27,
	// Space key
	Space		= 32,

	// Numeric keypad 0
	Keypad0		= 256,
	// Numeric keypad 1
	Keypad1		= 257,
	// Numeric keypad 2
	Keypad2		= 258,
	// Numeric keypad 3
	Keypad3		= 259,
	// Numeric keypad 4
	Keypad4		= 260,
	// Numeric keypad 5
	Keypad5		= 261,
	// Numeric keypad 6
	Keypad6		= 262,
	// Numeric keypad 7
	Keypad7		= 263,
	// Numeric keypad 8
	Keypad8		= 264,
	// Numeric keypad 9
	Keypad9		= 265,
	// Numeric keypad '.'
	KeypadPeriod	= 266,
	// Numeric keypad '/'
	KeypadDivide		= 267,
	// Numeric keypad '*'
	KeypadMultiply	= 268,
	// Numeric keypad '-'
	KeypadMinus		= 269,
	// Numeric keypad '+'
	KeypadPlus		= 270,
	// Numeric keypad enter
	KeypadEnter		= 271,
	// Numeric keypad '='
	KeypadEquals		= 272,

	// Up arrow key
	UpArrow			= 273,
	// Down arrow key
	DownArrow		= 274,
	// Right arrow key
	RightArrow		= 275,
	// Left arrow key
	LeftArrow		= 276,
	// Insert key key
	Insert		= 277,
	// Home key
	Home		= 278,
	// End key
	End		= 279,
	// Page up
	PageUp		= 280,
	// Page down
	PageDown		= 281,

	// F1 function key
	F1			= 282,
	// F2 function key
	F2			= 283,
	// F3 function key
	F3			= 284,
	// F4 function key
	F4			= 285,
	// F5 function key
	F5			= 286,
	// F6 function key
	F6			= 287,
	// F7 function key
	F7			= 288,
	// F8 function key
	F8			= 289,
	// F9 function key
	F9			= 290,
	// F10 function key
	F10		= 291,
	// F11 function key
	F11		= 292,
	// F12 function key
	F12		= 293,
	// F13 function key
	F13		= 294,
	// F14 function key
	F14		= 295,
	// F15 function key
	F15		= 296,

	// The '0' key on the top of the alphanumeric keyboard.
	Alpha0			= 48,	
	// The '1' key on the top of the alphanumeric keyboard.
	Alpha1			= 49,
	// The '2' key on the top of the alphanumeric keyboard.
	Alpha2			= 50,
	// The '3' key on the top of the alphanumeric keyboard.
	Alpha3			= 51,
	// The '4' key on the top of the alphanumeric keyboard.
	Alpha4			= 52,
	// The '5' key on the top of the alphanumeric keyboard.
	Alpha5			= 53,
	// The '6' key on the top of the alphanumeric keyboard.
	Alpha6			= 54,
	// The '7' key on the top of the alphanumeric keyboard.
	Alpha7			= 55,
	// The '8' key on the top of the alphanumeric keyboard.
	Alpha8			= 56,
	// The '9' key on the top of the alphanumeric keyboard.
	Alpha9			= 57,

	// Exclamation mark key '!'
	Exclaim		= 33,
	// Double quote key '"'
	DoubleQuote		= 34,
	// Hash key '#'
	Hash		= 35,
	// Dollar sign key '$'
	Dollar		= 36,
	// Ampersand key '&'
	Ampersand		= 38,
	// Quote key '
	Quote		= 39,
	// Left Parenthesis key '('
	LeftParen		= 40,
	// Right Parenthesis key ')'
	RightParen		= 41,
	// Asterisk key '*'
	Asterisk		= 42,
	// Plus key '+'
	Plus		= 43,
	// Comma ',' key
	Comma		= 44,

	// Minus '-' key
	Minus		= 45,
	// Period '.' key
	Period		= 46,
	// Slash '/' key
	Slash		= 47,

	// Colon ':' key
	Colon		= 58,
	// Semicolon ';' key
	Semicolon      = 59,
	// Less than '<' key
	Less		= 60,
	// Equals '=' key
	Equals		= 61,
	// Greater than '>' key
	Greater		= 62,
	// Question mark '?' key
	Question		= 63,
	// At key '@'
	At			= 64,
	
	// Left square bracket key '['
	LeftBracket	= 91,
	// Backslash key '\'
	Backslash		= 92,
	// Right square bracket key ']'
	RightBracket	= 93,
	// Caret key '^'
	Caret		= 94,
	// Underscore '_' key
	Underscore		= 95,
	// Back quote key '`'
	BackQuote		= 96,

	// 'a' key
	A			= 97,
	// 'b' key
	B			= 98,
	// 'c' key
	C			= 99,
	// 'd' key
	D			= 100,
	// 'e' key
	E			= 101,
	// 'f' key
	F			= 102,
	// 'g' key
	G			= 103,
	// 'h' key
	H			= 104,
	// 'i' key
	I			= 105,
	// 'j' key
	J			= 106,
	// 'k' key
	K			= 107,
	// 'l' key
	L			= 108,
	// 'm' key
	M			= 109,
	// 'n' key
	N			= 110,
	// 'o' key
	O			= 111,
	// 'p' key
	P			= 112,
	// 'q' key
	Q			= 113,
	// 'r' key
	R			= 114,
	// 's' key
	S			= 115,
	// 't' key
	T			= 116,
	// 'u' key
	U			= 117,
	// 'v' key
	V			= 118,
	// 'w' key
	W			= 119,
	// 'x' key
	X			= 120,
	// 'y' key
	Y			= 121,
	// 'z' key
	Z			= 122,

	// Numlock key
	Numlock		= 300,
	// Capslock key
	CapsLock		= 301,
	// Scroll lock key
	ScrollLock		= 302,
	// Right shift key
	RightShift		= 303,
	// Left shift key
	LeftShift		= 304,
	// Right Control key
	RightControl		= 305,
	// Left Control key
	LeftControl		= 306,
	// Right Alt key
	RightAlt		= 307,
	// Left Alt key
	LeftAlt		= 308,

	// Left Command key
	LeftCommand		= 310,
	// Left Command key
	LeftApple		= 310,
	// Left Windows key
	LeftWindows		= 311,
	// Right Command key
	RightCommand	= 309,
	// Right Command key
	RightApple		= 309,
	// Right Windows key
	RightWindows		= 312,
	// Alt Gr key
	AltGr		= 313,		

	// Help key
	Help		= 315,
	// Print key
	Print		= 316,
	// Sys Req key
	SysReq		= 317,
	// Break key
	Break		= 318,
	// Menu key
	Menu		= 319,
	
	// First (primary) mouse button
	Mouse0		= 323,
	// Second (secondary) mouse button
	Mouse1		= 324,
	// Third mouse button
	Mouse2		= 325,
	// Fourth mouse button
	Mouse3		= 326,
	// Fifth mouse button
	Mouse4		= 327,
	// Sixth mouse button
	Mouse5		= 328,
	// Seventh mouse button
	Mouse6		= 329,

	// Button 0 on any joystick
	JoystickButton0		= 330,
	// Button 1 on any joystick
	JoystickButton1		= 331,
	// Button 2 on any joystick
	JoystickButton2		= 332,
	// Button 3 on any joystick
	JoystickButton3		= 333,
	// Button 4 on any joystick
	JoystickButton4		= 334,
	// Button 5 on any joystick
	JoystickButton5		= 335,
	// Button 6 on any joystick
	JoystickButton6		= 336,
	// Button 7 on any joystick
	JoystickButton7		= 337,
	// Button 8 on any joystick
	JoystickButton8		= 338,
	// Button 9 on any joystick
	JoystickButton9		= 339,
	// Button 10 on any joystick
	JoystickButton10	= 340,
	// Button 11 on any joystick
	JoystickButton11	= 341,
	// Button 12 on any joystick
	JoystickButton12	= 342,
	// Button 13 on any joystick
	JoystickButton13	= 343,
	// Button 14 on any joystick
	JoystickButton14	= 344,
	// Button 15 on any joystick
	JoystickButton15	= 345,
	// Button 16 on any joystick
	JoystickButton16	= 346,
	// Button 17 on any joystick
	JoystickButton17	= 347,
	// Button 18 on any joystick
	JoystickButton18	= 348,
	// Button 19 on any joystick
	JoystickButton19	= 349,

	// Button 0 on first joystick
	Joystick1Button0		= 350,
	// Button 1 on first joystick
	Joystick1Button1		= 351,
	// Button 2 on first joystick
	Joystick1Button2		= 352,
	// Button 3 on first joystick
	Joystick1Button3		= 353,
	// Button 4 on first joystick
	Joystick1Button4		= 354,
	// Button 5 on first joystick
	Joystick1Button5		= 355,
	// Button 6 on first joystick
	Joystick1Button6		= 356,
	// Button 7 on first joystick
	Joystick1Button7		= 357,
	// Button 8 on first joystick
	Joystick1Button8		= 358,
	// Button 9 on first joystick
	Joystick1Button9		= 359,
	// Button 10 on first joystick
	Joystick1Button10	= 360,
	// Button 11 on first joystick
	Joystick1Button11	= 361,
	// Button 12 on first joystick
	Joystick1Button12	= 362,
	// Button 13 on first joystick
	Joystick1Button13	= 363,
	// Button 14 on first joystick
	Joystick1Button14	= 364,
	// Button 15 on first joystick
	Joystick1Button15	= 365,
	// Button 16 on first joystick
	Joystick1Button16	= 366,
	// Button 17 on first joystick
	Joystick1Button17	= 367,
	// Button 18 on first joystick
	Joystick1Button18	= 368,
	// Button 19 on first joystick
	Joystick1Button19	= 369,

	// Button 0 on second joystick
	Joystick2Button0		= 370,
	// Button 1 on second joystick
	Joystick2Button1		= 371,
	// Button 2 on second joystick
	Joystick2Button2		= 372,
	// Button 3 on second joystick
	Joystick2Button3		= 373,
	// Button 4 on second joystick
	Joystick2Button4		= 374,
	// Button 5 on second joystick
	Joystick2Button5		= 375,
	// Button 6 on second joystick
	Joystick2Button6		= 376,
	// Button 7 on second joystick
	Joystick2Button7		= 377,
	// Button 8 on second joystick
	Joystick2Button8		= 378,
	// Button 9 on second joystick
	Joystick2Button9		= 379,
	// Button 10 on second joystick
	Joystick2Button10	= 380,
	// Button 11 on second joystick
	Joystick2Button11	= 381,
	// Button 12 on second joystick
	Joystick2Button12	= 382,
	// Button 13 on second joystick
	Joystick2Button13	= 383,
	// Button 14 on second joystick
	Joystick2Button14	= 384,
	// Button 15 on second joystick
	Joystick2Button15	= 385,
	// Button 16 on second joystick
	Joystick2Button16	= 386,
	// Button 17 on second joystick
	Joystick2Button17	= 387,
	// Button 18 on second joystick
	Joystick2Button18	= 388,
	// Button 19 on second joystick
	Joystick2Button19	= 389,

	// Button 0 on third joystick
	Joystick3Button0		= 390,
	// Button 1 on third joystick
	Joystick3Button1		= 391,
	// Button 2 on third joystick
	Joystick3Button2		= 392,
	// Button 3 on third joystick
	Joystick3Button3		= 393,
	// Button 4 on third joystick
	Joystick3Button4		= 394,
	// Button 5 on third joystick
	Joystick3Button5		= 395,
	// Button 6 on third joystick
	Joystick3Button6		= 396,
	// Button 7 on third joystick
	Joystick3Button7		= 397,
	// Button 8 on third joystick
	Joystick3Button8		= 398,
	// Button 9 on third joystick
	Joystick3Button9		= 399,
	// Button 10 on third joystick
	Joystick3Button10	= 400,
	// Button 11 on third joystick
	Joystick3Button11	= 401,
	// Button 12 on third joystick
	Joystick3Button12	= 402,
	// Button 13 on third joystick
	Joystick3Button13	= 403,
	// Button 14 on third joystick
	Joystick3Button14	= 404,
	// Button 15 on third joystick
	Joystick3Button15	= 405,
	// Button 16 on third joystick
	Joystick3Button16	= 406,
	// Button 17 on third joystick
	Joystick3Button17	= 407,
	// Button 18 on third joystick
	Joystick3Button18	= 408,
	// Button 19 on third joystick
	Joystick3Button19	= 409,

	// Button 0 on forth joystick
	Joystick4Button0		= 410,
	// Button 1 on forth joystick
	Joystick4Button1		= 411,
	// Button 2 on forth joystick
	Joystick4Button2		= 412,
	// Button 3 on forth joystick
	Joystick4Button3		= 413,
	// Button 4 on forth joystick
	Joystick4Button4		= 414,
	// Button 5 on forth joystick
	Joystick4Button5		= 415,
	// Button 6 on forth joystick
	Joystick4Button6		= 416,
	// Button 7 on forth joystick
	Joystick4Button7		= 417,
	// Button 8 on forth joystick
	Joystick4Button8		= 418,
	// Button 9 on forth joystick
	Joystick4Button9		= 419,
	// Button 10 on forth joystick
	Joystick4Button10	= 420,
	// Button 11 on forth joystick
	Joystick4Button11	= 421,
	// Button 12 on forth joystick
	Joystick4Button12	= 422,
	// Button 13 on forth joystick
	Joystick4Button13	= 423,
	// Button 14 on forth joystick
	Joystick4Button14	= 424,
	// Button 15 on forth joystick
	Joystick4Button15	= 425,
	// Button 16 on forth joystick
	Joystick4Button16	= 426,
	// Button 17 on forth joystick
	Joystick4Button17	= 427,
	// Button 18 on forth joystick
	Joystick4Button18	= 428,
	// Button 19 on forth joystick
	Joystick4Button19	= 429,

	// We could expose all 10 joysticks here, but I think that a user would rarely want to explicitly 
	// specify a fifth or higher joystick (and they still can using the string version of Input.KeyDown).
	// Four joysticks, however, are a common setup (especially on consoles), and we've had a bug report 
	// for only exposing three, so I added a forth.
END



// Types of UnityGUI input and processing events.
ENUM EventType
	// Mouse button was pressed. 
	MouseDown = 0,
	// Mouse button was released. 
	MouseUp = 1,
	// Mouse was moved (editor views only).
	MouseMove = 2,
	// Mouse was dragged.
	MouseDrag = 3,
	// A keyboard key was pressed. 
	KeyDown = 4,
	// A keyboard key was released. 
	KeyUp = 5,
	// The scroll wheel was moved.
	ScrollWheel = 6,
	// A repaint event. One is sent every frame. 
	Repaint = 7,
	// A layout event.
	Layout = 8,

	// Editor only: drag & drop operation updated.
	DragUpdated = 9,
	// Editor only: drag & drop operation performed.
	DragPerform = 10,
	// Editor only: drag & drop operation exited.
	DragExited = 15,

	// [[Event]] should be ignored.
	Ignore = 11,

	// Already processed event.
	Used = 12,

	// Validates a special command (e.g. copy & paste)
	ValidateCommand = 13,

	// Execute a special command (eg. copy & paste)
	ExecuteCommand = 14,

	// User has right-clicked (or control-clicked on the mac).
	ContextClick = 16,
	
	OBSOLETE planned Please use EventType.MouseDown (with a capital M)
	mouseDown = 0,
	OBSOLETE planned Please use EventType.MouseUp (with a capital M)
	mouseUp = 1,
	OBSOLETE planned Please use EventType.MouseMove (with a capital M)
	mouseMove = 2,
	OBSOLETE planned Please use EventType.MouseDrag (with a capital M)
	mouseDrag = 3,
	OBSOLETE planned Please use EventType.KeyDown (with a capital K)
	keyDown = 4,
	OBSOLETE planned Please use EventType.KeyUp (with a capital K)
	keyUp = 5,
	OBSOLETE planned Please use EventType.ScrollWheel (with a capital S)
	scrollWheel = 6,
	OBSOLETE planned Please use EventType.Repaint (with a capital R)
	repaint = 7,
	OBSOLETE planned Please use EventType.Layout (with a capital L)
	layout = 8,

	OBSOLETE planned Please use EventType.DragUpdated (with a capital D)
	dragUpdated = 9,
	OBSOLETE planned Please use EventType.DragPerform (with a capital D)
	dragPerform = 10,

	OBSOLETE planned Please use EventType.Ignore (with a capital I)
	ignore = 11,

	OBSOLETE planned Please use EventType.Used (with a capital U)
	used = 12
END

// Types of modifier key that can be active during a keystroke event.
CSRAW [Flags]
ENUM EventModifiers 
	// Shift key
	Shift = 1,
	
	// Control key
	Control = 2,
	
	// Alt key
	Alt = 4,
	
	// Command key (Mac)
	Command = 8,
	
	// Num lock key
	Numeric = 16,
	
	// Caps lock key
	CapsLock = 32,
	
	// Function key
	FunctionKey = 64
END


CSRAW }