[Title] retrieves the status of host NumLock & CapsLock key in windows
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 29 Mar 2012 01:28:35 +0000 (10:28 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 29 Mar 2012 01:28:35 +0000 (10:28 +0900)
[Type]
[Module] Emulator
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/emul_state.c

index 326ffcd..f05846b 100644 (file)
@@ -131,7 +131,7 @@ MultiTouchState *get_emul_multi_touch_state(void)
     return &(_emul_state.qemu_mts);
 }
 
-/* get host key state */
+/* retrieves the status of the host lock key */
 int get_host_lock_key_state(int key)
 {
 #if defined( __linux__)
@@ -151,7 +151,15 @@ int get_host_lock_key_state(int key)
 
     return -1;
 #elif defined(_WIN32)
-    //TODO:
+    int nVirtKey = 0;
+
+    if (key == HOST_CAPSLOCK_KEY) {
+        nVirtKey = VK_CAPITAL;
+    } else if (key == HOST_NUMLOCK_KEY) {
+        nVirtKey = VK_NUMLOCK;
+    }
+
+    return (GetKeyState(nVirtKey) & 1) != 0;
 #endif
 
     return 0;