This repository was archived by the owner on Dec 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ export async function activate(context: vscode.ExtensionContext) {
216
216
}
217
217
218
218
break ;
219
-
219
+ case WEBVIEW_MESSAGES . GESTURE :
220
220
case WEBVIEW_MESSAGES . SENSOR_CHANGED :
221
221
handleGestureTelemetry ( message . text ) ;
222
222
console . log ( `Sensor changed ${ messageJson } \n` ) ;
Original file line number Diff line number Diff line change 7
7
SENSOR_LIST ,
8
8
VSCODE_MESSAGES_TO_WEBVIEW ,
9
9
WEBVIEW_MESSAGES ,
10
+ GESTURES ,
10
11
} from "../../constants" ;
11
12
import "../../styles/Simulator.css" ;
12
13
import * as TOOLBAR_SVG from "../../svgs/toolbar_svg" ;
@@ -27,7 +28,7 @@ const DEFAULT_STATE = {
27
28
[ SENSOR_LIST . MOTION_Y ] : 0 ,
28
29
[ SENSOR_LIST . MOTION_Z ] : 0 ,
29
30
} ,
30
- currentSelectedGesture : undefined ,
31
+ currentSelectedGesture : GESTURES [ 0 ] ,
31
32
} ;
32
33
33
34
export class Microbit extends React . Component < { } , IState > {
Original file line number Diff line number Diff line change 1
1
import * as React from "react" ;
2
- import { SENSOR_LIST } from "../../../constants" ;
2
+ import { SENSOR_LIST , GESTURES } from "../../../constants" ;
3
3
import { ISensorProps , ISliderProps } from "../../../viewUtils" ;
4
4
import { ThreeDimensionSlider } from "./threeDimensionSlider/ThreeDimensionSlider" ;
5
5
import { Dropdown } from "../../Dropdown" ;
@@ -50,7 +50,7 @@ interface IProps {
50
50
onSelectGestures ?: ( event : React . ChangeEvent < HTMLSelectElement > ) => void ;
51
51
onSendGesture ?: ( ) => void ;
52
52
}
53
- const GESTURES = [ "shake" , "up" ] ;
53
+
54
54
const GESTURE_BUTTON_MESSAGE = "Send Gesture" ;
55
55
56
56
export const Accelerometer : React . FC < IProps > = ( props : IProps ) => {
Original file line number Diff line number Diff line change @@ -99,4 +99,18 @@ export enum SENSOR_LIST {
99
99
MOTION_Z = "motion_z" ,
100
100
}
101
101
102
+ export const GESTURES = [
103
+ "shake" ,
104
+ "up" ,
105
+ "down" ,
106
+ "left" ,
107
+ "right" ,
108
+ "face up" ,
109
+ "face down" ,
110
+ "freefall" ,
111
+ "3g" ,
112
+ "6g" ,
113
+ "8g" ,
114
+ ] ;
115
+
102
116
export default CONSTANTS ;
Original file line number Diff line number Diff line change 1
1
.dropdown {
2
2
background : var (--vscode-debugToolBar-background );
3
- border-color : var (--vscode-highContrastButtonBorderOverride-color );
3
+ border-color : var (--vscode-foreground );
4
4
border-radius : 2px ;
5
5
max-width : 300px ;
6
6
min-width : 240px ;
You can’t perform that action at this time.
0 commit comments