1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
15 /// The key structure is used to store a key press.
17 public class Key : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Key(global::System.IntPtr cPtr, bool cMemoryOwn)
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj)
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 DisposeQueue.Instance.Add(this);
38 public virtual void Dispose()
40 if (!Stage.IsInstalled())
42 DisposeQueue.Instance.Add(this);
48 if (swigCPtr.Handle != global::System.IntPtr.Zero)
53 NDalicPINVOKE.delete_Key(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
62 internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)
64 Key ret = new Key(cPtr, false);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 /// Name given to the key pressed
72 public string KeyPressedName
76 return keyPressedName;
80 /* duplicated with KeyPressedName : removed
81 public string KeyPressed
91 /// Keycode for the key pressed.
102 /// Special keys like shift, alt and control which modify the next key pressed.
104 public int KeyModifier
113 /// The time (in ms) that the key event occurred.
124 /// State of the key event.
126 public Key.StateType State
135 /// Default Constructor.
137 public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 /// <param name="keyName">The name of the key pressed or command from the IMF, if later then the some following parameters will be needed</param>
146 /// <param name="keyString">A string of input characters or key pressed</param>
147 /// <param name="keyCode">The unique key code for the key pressed</param>
148 /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
149 /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
150 /// <param name="keyState">The state of the key event</param>
151 public Key(string keyName, string keyString, int keyCode, int keyModifier, uint timeStamp, Key.StateType keyState) : this(NDalicPINVOKE.new_Key__SWIG_1(keyName, keyString, keyCode, keyModifier, timeStamp, (int)keyState), true)
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 /// Checks to see if Shift key modifier has been supplied.
159 /// <returns>True if shift modifier</returns>
160 public bool IsShiftModifier()
162 bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 /// Checks to see if Ctrl (control) key modifier has been supplied.
170 /// <returns>True if ctrl modifier</returns>
171 public bool IsCtrlModifier()
173 bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 /// Checks to see if Alt key modifier has been supplied.
181 /// <returns>True if alt modifier</returns>
182 public bool IsAltModifier()
184 bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 private string keyPressedName
193 NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 private string keyPressed
208 NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 private int keyModifier
238 NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 NDalicPINVOKE.Key_time_set(swigCPtr, value);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 private Key.StateType state
268 NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 /// Enumeration for specifying the state of the key event.
282 public enum StateType