sync with latest
[sdk/emulator/qemu.git] / tizen / src / emul_state_darwin.m
1 /*
2  * Emulator
3  *
4  * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * Kitae Kim <kt920.kim@samsung.com>
8  * SeokYeon Hwang <syeon.hwang@samsung.com>
9  * MunKyu Im <munkyu.im@samsung.com>
10  * GiWoong Kim <giwoong.kim@samsung.com>
11  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26  *
27  * Contributors:
28  * - S-Core Co., Ltd
29  *
30  */
31
32 #import <Cocoa/Cocoa.h>
33 #import <AppKit/NSEvent.h>
34
35 #include "emul_state.h"
36
37 /* retrieves the status of the host lock key */
38 int get_host_lock_key_state_darwin(int key)
39 {
40     /* support only capslock */
41     if (key == HOST_CAPSLOCK_KEY) {
42         return ((NSAlphaShiftKeyMask & [NSEvent modifierFlags]) ? 1 : 0);
43     } else if (key == HOST_NUMLOCK_KEY) {
44         return 0;
45     }
46
47     return -1;
48 }