Skip to content

Commit eb90aa1

Browse files
committed
[ADD] converter of microbit_gesture function
1 parent 37b65df commit eb90aa1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/ruby-to-blocks-converter/microbit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ const MicroBitConverter = {
2626
this._setParent(rubyBlock, block);
2727
}
2828
break;
29+
case 'microbit_gesture':
30+
if (args.length === 2 && this._isString(args[1])) {
31+
block = this._createBlock('microbit_whenGesture', 'hat');
32+
this._addFieldInput(
33+
block, 'GESTURE', 'microbit_menu_gestures', 'gestures',
34+
args[1], 'moved'
35+
)
36+
this._setParent(rubyBlock, block);
37+
}
38+
break;
2939
}
3040
} else if (this._isSelf(receiver) || receiver === Opal.nil) {
3141
switch (name) {

0 commit comments

Comments
 (0)