Check-in [5834ca6766]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add modifiers to the key and mouse events.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | wip-midlcdui
Files: files | file ages | folders
SHA1:5834ca6766047df577e87a48bebf4da0ce60c698
User & Date: stephanie.gawroriski 2020-08-02 16:25:30
Context
2020-08-02
16:25
Add modifiers to the key and mouse events. Leaf check-in: 5834ca6766 user: stephanie.gawroriski tags: wip-midlcdui
16:20
Service repaints to force them to happen. check-in: 21d1c8a12a user: stephanie.gawroriski tags: wip-midlcdui
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/callbacks/UIFormCallback.java.

10
11
12
13
14
15
16

17
18
19
20
21
22
23
..
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
package cc.squirreljme.jvm.mle.callbacks;

import cc.squirreljme.jvm.mle.brackets.UIFormBracket;
import cc.squirreljme.jvm.mle.brackets.UIItemBracket;
import cc.squirreljme.jvm.mle.constants.UIItemIntegerProperty;
import cc.squirreljme.jvm.mle.constants.UIItemStringProperty;
import cc.squirreljme.jvm.mle.constants.UIKeyEventType;

import cc.squirreljme.jvm.mle.constants.UIMouseButton;
import cc.squirreljme.jvm.mle.constants.UIMouseEventType;

/**
 * Interface that is used a callback on a user-interface form is to be done.
 *
 * @since 2020/07/03
................................................................................
	/**
	 * This is called on a keyboard/joystick action.
	 * 
	 * @param __form The form acted on.
	 * @param __item The item acted on.
	 * @param __event One of {@link UIKeyEventType}.
	 * @param __keyCode Key code for the event.

	 * @since 2020/07/19
	 */
	void eventKey(UIFormBracket __form, UIItemBracket __item, int __event,
		int __keyCode);
	
	/**
	 * This is called on a mouse action.
	 * 
	 * @param __form The form acted on.
	 * @param __item The item acted on.
	 * @param __event One of {@link UIMouseEventType}.
	 * @param __button One of {@link UIMouseButton}.
	 * @param __x The X coordinate.
	 * @param __y The Y coordinate.

	 * @since 2020/07/19
	 */
	void eventMouse(UIFormBracket __form, UIItemBracket __item, int __event,
		int __button, int __x, int __y);
	
	/**
	 * Draw action for the given item.
	 * 
	 * @param __form The form to be acted on.
	 * @param __item The item to draw.
	 * @since 2020/07/19







>







 







>



|










>



|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
package cc.squirreljme.jvm.mle.callbacks;

import cc.squirreljme.jvm.mle.brackets.UIFormBracket;
import cc.squirreljme.jvm.mle.brackets.UIItemBracket;
import cc.squirreljme.jvm.mle.constants.UIItemIntegerProperty;
import cc.squirreljme.jvm.mle.constants.UIItemStringProperty;
import cc.squirreljme.jvm.mle.constants.UIKeyEventType;
import cc.squirreljme.jvm.mle.constants.UIKeyModifier;
import cc.squirreljme.jvm.mle.constants.UIMouseButton;
import cc.squirreljme.jvm.mle.constants.UIMouseEventType;

/**
 * Interface that is used a callback on a user-interface form is to be done.
 *
 * @since 2020/07/03
................................................................................
	/**
	 * This is called on a keyboard/joystick action.
	 * 
	 * @param __form The form acted on.
	 * @param __item The item acted on.
	 * @param __event One of {@link UIKeyEventType}.
	 * @param __keyCode Key code for the event.
	 * @param __modifiers Bit mask of {@link UIKeyModifier}.
	 * @since 2020/07/19
	 */
	void eventKey(UIFormBracket __form, UIItemBracket __item, int __event,
		int __keyCode, int __modifiers);
	
	/**
	 * This is called on a mouse action.
	 * 
	 * @param __form The form acted on.
	 * @param __item The item acted on.
	 * @param __event One of {@link UIMouseEventType}.
	 * @param __button One of {@link UIMouseButton}.
	 * @param __x The X coordinate.
	 * @param __y The Y coordinate.
	 * @param __modifiers Bit mask of {@link UIKeyModifier}.
	 * @since 2020/07/19
	 */
	void eventMouse(UIFormBracket __form, UIItemBracket __item, int __event,
		int __button, int __x, int __y, int __modifiers);
	
	/**
	 * Draw action for the given item.
	 * 
	 * @param __form The form to be acted on.
	 * @param __item The item to draw.
	 * @since 2020/07/19

Added modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyModifier.java.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.mle.constants;

/**
 * Modifier keys for when key and mouse events occur.
 *
 * @since 2020/08/02
 */
public interface UIKeyModifier
{
	/** Alt key modifier. */
	int MODIFIER_ALT =
		65536;
		
	/** Ctrl key modifier. */
	int MODIFIER_CHR =
		8388608;
	
	/** Command key modifier. */
	int MODIFIER_COMMAND =
		4194304;
	
	/** Ctrl key modifier. */
	int MODIFIER_CTRL =
		262144;
	
	/** Mask for all the modifier keys. */
	int MODIFIER_MASK =
		13041664;
	
	/** Shift key modifier. */
	int MODIFIER_SHIFT =
		131072;
}

Changes to modules/meep-key/src/main/java/javax/microedition/key/KeyListener.java.

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
109
110
111
		9;
		
	int KEY_UP =
		-1;
		
	int LEFT =
		2;
		

	int MODIFIER_ALT =
		65536;
		

	int MODIFIER_CHR =
		8388608;
		

	int MODIFIER_COMMAND =
		4194304;
		

	int MODIFIER_CTRL =
		262144;
		

	int MODIFIER_MASK =
		13041664;
		

	int MODIFIER_SHIFT =
		131072;
		
	int RIGHT =
		5;
		
	int UP =







|
>



>


|
>


|
>


|
>


|
>







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
109
110
111
112
113
114
115
116
117
		9;
		
	int KEY_UP =
		-1;
		
	int LEFT =
		2;
	
	/** Alt key modifier. */
	int MODIFIER_ALT =
		65536;
		
	/** Ctrl key modifier. */
	int MODIFIER_CHR =
		8388608;
	
	/** Command key modifier. */
	int MODIFIER_COMMAND =
		4194304;
	
	/** Ctrl key modifier. */
	int MODIFIER_CTRL =
		262144;
	
	/** Mask for all the modifier keys. */
	int MODIFIER_MASK =
		13041664;
	
	/** Shift key modifier. */
	int MODIFIER_SHIFT =
		131072;
		
	int RIGHT =
		5;
		
	int UP =

Changes to modules/midp-lcdui/src/main/java/javax/microedition/lcdui/KeyListener.java.

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
 * to these methods will be modified by the key modifiers (this means that
 * if shift is held down then letters will be uppercase).
 *
 * @since 2017/02/12
 */
public interface KeyListener
{
	/** The chr alt modifier. */
	int MODIFIER_ALT =
		65536;

	/** The chr key modifier. */
	int MODIFIER_CHR =
		8388608;

	/** The command key modifier. */
	int MODIFIER_COMMAND =
		4194304;

	/** The ctrl key modifier. */
	int MODIFIER_CTRL =
		262144;

	/** The mask for modifiers. */
	int MODIFIER_MASK =
		13041664;

	/** The shift key modifier. */
	int MODIFIER_SHIFT =
		131072;
	
	/**
	 * Called when a key is pressed.
	 *
	 * @param __kc The key code.







|


|
|


|
|


|
|


|
|


|
|







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
 * to these methods will be modified by the key modifiers (this means that
 * if shift is held down then letters will be uppercase).
 *
 * @since 2017/02/12
 */
public interface KeyListener
{
	/** Alt key modifier. */
	int MODIFIER_ALT =
		65536;
		
	/** Ctrl key modifier. */
	int MODIFIER_CHR =
		8388608;
	
	/** Command key modifier. */
	int MODIFIER_COMMAND =
		4194304;
	
	/** Ctrl key modifier. */
	int MODIFIER_CTRL =
		262144;
	
	/** Mask for all the modifier keys. */
	int MODIFIER_MASK =
		13041664;
	
	/** Shift key modifier. */
	int MODIFIER_SHIFT =
		131072;
	
	/**
	 * Called when a key is pressed.
	 *
	 * @param __kc The key code.