/* Check the given key range */
if (krt->max_tizen_hwkeys < key)
{
- KLWRN("Invalid range of key ! (keycode:%d)", key);
+ KLWRN("Invalid range of key ! (keycode:%d) maximum value(%d)", key, krt->max_tizen_hwkeys);
return TIZEN_KEYROUTER_ERROR_INVALID_KEY;
}
* Only key listed in Tizen key layout file can be grabbed. */
if (0 == krt->HardKeys[key].keycode)
{
- KLWRN("Invalid key ! Disabled to grab ! (keycode:%d)", key);
+ KLWRN("Invalid key ! Disabled to set keygrab ! (keycode:%d)", key);
return TIZEN_KEYROUTER_ERROR_INVALID_KEY;
}
int
e_keyrouter_keygrab_unset(struct wl_client *client, struct wl_resource *surface, int key)
{
+
+ /* Check the given key range */
+ if (krt->max_tizen_hwkeys < key)
+ {
+ KLWRN("Invalid range of key ! (keycode:%d) maximum value(%d)", key, krt->max_tizen_hwkeys);
+ return TIZEN_KEYROUTER_ERROR_INVALID_KEY;
+ }
+
+ /* Check whether the key can be unset or not !
+ * Only key listed in Tizen key layout file can be unset. */
+ if (0 == krt->HardKeys[key].keycode)
+ {
+ KLWRN("Invalid key ! Disabled to unset keygrab! (keycode:%d)", key);
+ return TIZEN_KEYROUTER_ERROR_INVALID_KEY;
+ }
+
/* Ungrab top position grabs first. This grab mode do not need privilege */
if (!surface)
e_keyrouter_find_and_remove_client_from_list(NULL, client, key, TIZEN_KEYROUTER_MODE_TOPMOST);