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();
69 public string DeviceName
73 string ret = NDalicPINVOKE.GetDeviceName(swigCPtr);
74 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 /// Name given to the key pressed
82 public string KeyPressedName
86 return keyPressedName;
90 /* duplicated with KeyPressedName : removed
91 public string KeyPressed
101 /// Keycode for the key pressed.
112 /// Special keys like shift, alt and control which modify the next key pressed.
114 public int KeyModifier
123 /// The time (in ms) that the key event occurred.
134 /// State of the key event.
136 public Key.StateType State
144 public DeviceClassType DeviceClass
148 int ret = NDalicPINVOKE.GetDeviceClass(swigCPtr);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 return (DeviceClassType)ret;
156 /// Default Constructor.
158 public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// <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>
167 /// <param name="keyString">A string of input characters or key pressed</param>
168 /// <param name="keyCode">The unique key code for the key pressed</param>
169 /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
170 /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
171 /// <param name="keyState">The state of the key event</param>
172 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)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public Key(Key rhs) : this(NDalicPINVOKE.new_Key__SWIG_2(Key.getCPtr(rhs)), true) {
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 public Key Assign(Key rhs) {
182 Key ret = new Key(NDalicPINVOKE.Key_Assign(swigCPtr, Key.getCPtr(rhs)), false);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Checks to see if Shift key modifier has been supplied.
189 /// <returns>True if shift modifier</returns>
190 public bool IsShiftModifier()
192 bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 /// Checks to see if Ctrl (control) key modifier has been supplied.
200 /// <returns>True if ctrl modifier</returns>
201 public bool IsCtrlModifier()
203 bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// Checks to see if Alt key modifier has been supplied.
211 /// <returns>True if alt modifier</returns>
212 public bool IsAltModifier()
214 bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 private string keyPressedName
223 NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 private string keyPressed
238 NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 private int keyModifier
268 NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 NDalicPINVOKE.Key_time_set(swigCPtr, value);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 private Key.StateType state
298 NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 /// Enumeration for specifying the state of the key event.
312 public enum StateType