Skip to content

Commit 6b69194

Browse files
committed
Added input snippets
1 parent c82ef0c commit 6b69194

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

snippets/input.json

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
11
{
2-
2+
"input.btn": {
3+
"prefix": "btn",
4+
"scope": "pico8p8",
5+
"body": [
6+
"btn(${1|left,right,up,down,fire1,fire2|},${2|1,2|})",
7+
"$0"
8+
],
9+
"description": "Get button state for given player (see pconsts for constants)"
10+
},
11+
"input.btnp": {
12+
"prefix": "btnp",
13+
"scope": "pico8p8",
14+
"body": [
15+
"btnp(${1|left,right,up,down,fire1,fire2|},${2|1,2|})",
16+
"$0"
17+
],
18+
"description": "Get 'repeating' button state for given player (see pconsts for constants)"
19+
},
20+
"input.dinput": {
21+
"prefix": "dinput",
22+
"scope": "pico8p8",
23+
"body": [
24+
"poke(0x5f2d, 1)",
25+
"$0"
26+
],
27+
"description": "Enable pico8 devkit input for mouse and keyboard input"
28+
},
29+
"input.dkeyp": {
30+
"prefix": "dkeyp",
31+
"scope": "pico8p8",
32+
"body": [
33+
"stat(30)"
34+
],
35+
"description": "(Boolean) True when a key pressed"
36+
},
37+
"input.dkey": {
38+
"prefix": "dkey",
39+
"scope": "pico8p8",
40+
"body": [
41+
"stat(31)"
42+
],
43+
"description": "(String) character returned by keyboard"
44+
},
45+
"input.dmousex": {
46+
"prefix": "dmousex",
47+
"scope": "pico8p8",
48+
"body": [
49+
"stat(32)"
50+
],
51+
"description": "Mouse X"
52+
},
53+
"input.dmousey": {
54+
"prefix": "dmousey",
55+
"scope": "pico8p8",
56+
"body": [
57+
"stat(33)"
58+
],
59+
"description": "Mouse Y"
60+
},
61+
"input.dmousebtn": {
62+
"prefix": "dmousebtn",
63+
"scope": "pico8p8",
64+
"body": [
65+
"stat(34)"
66+
],
67+
"description": "Mouse buttons bitfield"
68+
},
69+
"input.dmousewheel": {
70+
"prefix": "dmousewheel",
71+
"scope": "pico8p8",
72+
"body": [
73+
"stat(36)"
74+
],
75+
"description": "Mouse wheel event"
76+
}
377
}

0 commit comments

Comments
 (0)