forked from microsoft/pxt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuttonpair.ts
More file actions
29 lines (26 loc) · 778 Bytes
/
Copy pathbuttonpair.ts
File metadata and controls
29 lines (26 loc) · 778 Bytes
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
namespace pxsim {
export class Button {
constructor(public id: number) { }
pressed: boolean;
virtual: boolean;
}
export interface ButtonPairProps {
ID_BUTTON_A: number;
ID_BUTTON_B: number;
ID_BUTTON_AB: number;
BUTTON_EVT_UP: number;
BUTTON_EVT_CLICK: number;
}
export class ButtonPairState {
usesButtonAB: boolean = false;
aBtn: Button;
bBtn: Button;
abBtn: Button;
constructor(public props: ButtonPairProps) {
this.aBtn = new Button(this.props.ID_BUTTON_A);
this.bBtn = new Button(this.props.ID_BUTTON_B);
this.abBtn = new Button(this.props.ID_BUTTON_AB);
this.abBtn.virtual = true;
}
}
}