2
* To change this template, choose Tools | Templates
3
* and open the template in the editor.
6
package uk.org.dataforce.g15.plugins.buttonProgram;
8
import java.util.Timer;
9
import java.util.TimerTask;
10
import uk.org.dataforce.g15.G15Wrapper;
17
private static int keyPressed=0;
18
private static Timer flickerTimer;
19
private static Timer key123Timer;
20
private static int mButton = 0;
21
private static int flickerButton = 0;
22
private static boolean flickerOn = false;
23
private static G15Wrapper myScreen;
25
public Mkeys( G15Wrapper newScreen ){
29
public static void resetMButton() {
33
myScreen.setMXLight(0,false);
35
myScreen.setMXLight(mButton, true);
38
public static void changeMButton( int newButton ) {
39
if( flickerTimer != null){
40
changeFlickerMButton(newButton);
44
myScreen.setMXLight(mButton, false);
47
if (mButton == newButton) {
55
myScreen.setMXLight(mButton, newOn);
58
public static void changeFlickerMButton( int newButton ) {
59
myScreen.setMXLight(0,false);
61
flickerButton = newButton;
64
public static boolean checkKey123( int newButton ) {
69
else if( keyPressed==1 && newButton==2){
72
else if( keyPressed==2 && newButton==3){
76
if( keyPressed == 3 ){
84
public static void startKey123Timeout(){
85
key123Timer = new Timer();
86
key123Timer.schedule( new TimerTask(){ public void run() {
92
public static void stopKey123Timeout(){
93
if(key123Timer != null)
97
public static void changeflickerMButton( int newButton ){
98
flickerButton = newButton;
101
public static void startFlicker(){
102
flickerTimer = new Timer();
103
flickerTimer.schedule( new TimerTask(){ public void run() {
104
myScreen.setMXLight(flickerButton,flickerOn);
105
flickerOn = !flickerOn;
110
public static void stopFlicker(){
111
if(flickerTimer != null)
112
flickerTimer.cancel();
117
public static int getButton(){
121
public static int getToggleButton(){
122
return flickerButton;
b'\\ No newline at end of file'