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;
33 //A Flag to check who called Dispose(). (By User or DisposeQueue)
34 private bool isDisposeQueued = false;
35 //A Flat to check if it is already disposed.
36 protected bool disposed = false;
42 isDisposeQueued = true;
43 DisposeQueue.Instance.Add(this);
49 //Throw excpetion if Dispose() is called in separate thread.
50 if (!Window.IsInstalled())
52 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
57 Dispose(DisposeTypes.Implicit);
61 Dispose(DisposeTypes.Explicit);
62 System.GC.SuppressFinalize(this);
66 protected virtual void Dispose(DisposeTypes type)
73 if(type == DisposeTypes.Explicit)
76 //Release your own managed resources here.
77 //You should release all of your own disposable objects here.
80 //Release your own unmanaged resources here.
81 //You should not access any managed member here except static instance.
82 //because the execution order of Finalizes is non-deterministic.
84 if (swigCPtr.Handle != global::System.IntPtr.Zero)
89 NDalicPINVOKE.delete_Key(swigCPtr);
91 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)
99 Key ret = new Key(cPtr, false);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 public string DeviceName
108 string ret = NDalicPINVOKE.GetDeviceName(swigCPtr);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 /// Name given to the key pressed
117 public string KeyPressedName
121 return keyPressedName;
125 /* duplicated with KeyPressedName : removed
126 public string KeyPressed
136 /// Keycode for the key pressed.
147 /// Special keys like shift, alt and control which modify the next key pressed.
149 public int KeyModifier
158 /// The time (in ms) that the key event occurred.
169 /// State of the key event.
171 public Key.StateType State
179 public DeviceClassType DeviceClass
183 int ret = NDalicPINVOKE.GetDeviceClass(swigCPtr);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 return (DeviceClassType)ret;
191 /// Default Constructor.
193 public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 /// <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>
202 /// <param name="keyString">A string of input characters or key pressed</param>
203 /// <param name="keyCode">The unique key code for the key pressed</param>
204 /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
205 /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
206 /// <param name="keyState">The state of the key event</param>
207 internal 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)
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 /// Checks to see if Shift key modifier has been supplied.
215 /// <returns>True if shift modifier</returns>
216 public bool IsShiftModifier()
218 bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 /// Checks to see if Ctrl (control) key modifier has been supplied.
226 /// <returns>True if ctrl modifier</returns>
227 public bool IsCtrlModifier()
229 bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 /// Checks to see if Alt key modifier has been supplied.
237 /// <returns>True if alt modifier</returns>
238 public bool IsAltModifier()
240 bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 private string keyPressedName
249 NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 private string keyPressed
264 NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284 int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 private int keyModifier
294 NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 NDalicPINVOKE.Key_time_set(swigCPtr, value);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 private Key.StateType state
324 NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 /// Enumeration for specifying the state of the key event.
338 public enum StateType