Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/DOMKeyboardEvent.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Port to the D Programming language: | |
3 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
4 *******************************************************************************/ | |
5 module dwt.internal.cocoa.DOMKeyboardEvent; | |
6 | |
7 import dwt.internal.cocoa.NSObject; | |
8 import dwt.internal.cocoa.NSString; | |
9 import dwt.internal.cocoa.OS; | |
10 | |
11 public class DOMKeyboardEvent : NSObject { | |
12 | |
13 public this () { | |
14 super(); | |
15 } | |
16 | |
17 public this (int id) { | |
18 super(id); | |
19 } | |
20 | |
21 public bool altKey () { | |
22 return OS.objc_msgSend(this.id, OS.sel_altKey) !is 0; | |
23 } | |
24 | |
25 public int charCode () { | |
26 return OS.objc_msgSend(this.id, OS.sel_charCode); | |
27 } | |
28 | |
29 public bool ctrlKey () { | |
30 return OS.objc_msgSend(this.id, OS.sel_ctrlKey) !is 0; | |
31 } | |
32 | |
33 public bool getModifierState (NSString keyIdentifierArg) { | |
34 return OS.objc_msgSend(this.id, OS.sel_getModifierState_1, keyIdentifierArg !is null ? keyIdentifierArg.id : 0) !is 0; | |
35 } | |
36 | |
37 public int keyCode () { | |
38 return OS.objc_msgSend(this.id, OS.sel_keyCode); | |
39 } | |
40 | |
41 public int keyLocation () { | |
42 return OS.objc_msgSend(this.id, OS.sel_keyLocation); | |
43 } | |
44 | |
45 public bool metaKey () { | |
46 return OS.objc_msgSend(this.id, OS.sel_metaKey) !is 0; | |
47 } | |
48 | |
49 public void preventDefault () { | |
50 OS.objc_msgSend(this.id, OS.sel_preventDefault); | |
51 } | |
52 | |
53 public bool shiftKey () { | |
54 return OS.objc_msgSend(this.id, OS.sel_shiftKey) !is 0; | |
55 } | |
56 | |
57 } |