-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyCode.bas
More file actions
109 lines (104 loc) · 3.19 KB
/
KeyCode.bas
File metadata and controls
109 lines (104 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=5.9
@EndOfDesignText@
#IgnoreWarnings:12
'Class Module
Sub Class_Globals
'Private fx As JFX ' Uncomment if required. For B4j only
Private JO As JavaObject
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
'This is an autogenerated constructor, there may not be a matching constructor in the class, you will then have to remove the next line of code
JO.InitializeStatic("javafx.scene.input.KeyCode")
End Sub
'Returns the wrapped object as JavaObject
Public Sub AsJavaObject As JavaObject
Return JO
End Sub
'Parses textual representation of a key.
Public Sub GetKeyCode(Name As String) As KeyCode
Dim JO1 As JavaObject
JO1.InitializeStatic("javafx.scene.input.KeyCode")
Dim Wrapper As KeyCode
Wrapper.Initialize
Wrapper.SetObject(JO1.RunMethod("getKeyCode",Array As Object(Name)))
Return Wrapper
End Sub
'Gets name of this key code.
Public Sub GetName As String
Return JO.RunMethod("getName",Null)
End Sub
'Returns the wrapped object as Object
Public Sub GetObject As Object
Return JO
End Sub
'Left, right, up, down keys (including the keypad arrows)
Public Sub IsArrowKey As Boolean
Return JO.RunMethod("isArrowKey",Null)
End Sub
'All Digit keys (including the keypad digits)
Public Sub IsDigitKey As Boolean
Return JO.RunMethod("isDigitKey",Null)
End Sub
'Function keys like F1, F2, etc...
Public Sub IsFunctionKey As Boolean
Return JO.RunMethod("isFunctionKey",Null)
End Sub
'All keys on the keypad
Public Sub IsKeypadKey As Boolean
Return JO.RunMethod("isKeypadKey",Null)
End Sub
'All keys with letters
Public Sub IsLetterKey As Boolean
Return JO.RunMethod("isLetterKey",Null)
End Sub
'All multimedia keys (channel up/down, volume control, etc...)
Public Sub IsMediaKey As Boolean
Return JO.RunMethod("isMediaKey",Null)
End Sub
'Keys that could act as a modifier
Public Sub IsModifierKey As Boolean
Return JO.RunMethod("isModifierKey",Null)
End Sub
'Navigation keys are arrow keys and Page Down, Page Up, Home, End (including keypad keys)
Public Sub IsNavigationKey As Boolean
Return JO.RunMethod("isNavigationKey",Null)
End Sub
'Space, tab and enter
Public Sub IsWhitespaceKey As Boolean
Return JO.RunMethod("isWhitespaceKey",Null)
End Sub
'Returns the enum constant of this type with the specified name.
Public Sub ValueOf(Name As String) As KeyCode
Dim JO1 As JavaObject
JO1.InitializeStatic("javafx.scene.input.KeyCode")
Dim Wrapper As KeyCode
Wrapper.Initialize
Wrapper.SetObject(JO1.RunMethod("valueOf",Array As Object(Name)))
Return Wrapper
End Sub
'Returns an array containing the constants of this enum type, in the order they are declared.
Public Sub Values As KeyCode()
Dim JO1 As JavaObject
JO1.InitializeStatic("javafx.scene.input.KeyCode")
Return JO1.RunMethod("values",Null)
End Sub
'Comment if not needed
'Set the underlying Object, must be of correct type
Public Sub SetObject(Obj As Object)
JO = Obj
End Sub
'Set the Tag for this object
Public Sub SetTag(Tag As Object)
JO.RunMethod("setUserData",Array(Tag))
End Sub
'Get the Tag for this object
Public Sub GetTag As Object
Dim Tag As Object = JO.RunMethod("getUserData",Null)
If Tag = Null Then Tag = ""
Return Tag
End Sub