virtual-keypad 5.12.2 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +45 -45
- package/dist/404.html +14 -14
- package/dist/fonts/Pelli-EyeChart.svg +494 -494
- package/dist/fonts/Sloan.svg +138 -138
- package/dist/index.html +22 -22
- package/dist/keypad.html +58 -58
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +8 -8
- package/dist/main.js.map +1 -1
- package/dist/receiver.html +146 -118
- package/dist/server.js +66 -66
- package/package.json +36 -36
- package/src/keypad.css +108 -108
- package/src/keypad.js +385 -383
- package/src/keypadPeer.js +189 -189
- package/src/main.js +4 -4
- package/src/maxKeySize.js +104 -104
- package/src/receiver.css +11 -11
- package/src/receiver.js +223 -223
- package/webpack.common.js +30 -30
- package/webpack.dev.js +9 -9
- package/webpack.prod.js +6 -6
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 EasyEyes
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 EasyEyes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
# Virtual Keypad
|
|
2
|
-
|
|
3
|
-
Spawn and communicate with a virtual keypad, eg for use in online psychology
|
|
4
|
-
experiments.
|
|
5
|
-
|
|
6
|
-
This client-side module creates a QR Code linking to the appropriately
|
|
7
|
-
specified keypad, handle's a user-defined callback on the incoming data,
|
|
8
|
-
and allows for real-time changes to the keypad content.
|
|
9
|
-
|
|
10
|
-
## How
|
|
11
|
-
**tl;dr** instantiate a `Receiver`, eg from within a PsychoJS experiment,
|
|
12
|
-
and scan the generated QR Code from your mobile device. By default the user
|
|
13
|
-
is taken to a publically-hosted webpage wrapper around `Keypad`.
|
|
14
|
-
Use the `keypadURL` parameter of `Receiver` to instead direct
|
|
15
|
-
the user to a keypad hosted elsewhere.
|
|
16
|
-
|
|
17
|
-
### Receiver
|
|
18
|
-
Most users, eg experimenters, should only need to use the `Receiver` class.
|
|
19
|
-
This class handles configuring the content of the keypad (ie what symbols to
|
|
20
|
-
show, and in what font face), creates a link -- in the form of a QR code -- to
|
|
21
|
-
a keypad for the user to use.
|
|
22
|
-
|
|
23
|
-
## What
|
|
24
|
-
A simple (optionally self-hosted) keypad webapp, with user-specified callback behavior.
|
|
25
|
-
Built using [PeerJS](https://www.npmjs.com/package/peerjs) and [QRCode](https://www.npmjs.com/package/qrcode).
|
|
26
|
-
|
|
27
|
-
## Why
|
|
28
|
-
In [Denis Pelli's NYU psychology lab](https://denispelli.com),
|
|
29
|
-
we carry out a lot of psychophysical experiments. For example,
|
|
30
|
-
we may want to
|
|
31
|
-
[measure a participant's crowding](https://www.biorxiv.org/content/10.1101/2021.04.12.439570v1),
|
|
32
|
-
so we can investigate the possibility of a
|
|
33
|
-
[link between crowding performance and the size of the participants hV4](https://jov.arvojournals.org/article.aspx?articleid=2749904) region of the visual cortex.
|
|
34
|
-
These experiments often involve the participant responding to stimuli
|
|
35
|
-
with a keypress. If the task requires a long viewing distance, a
|
|
36
|
-
wireless keyboard is provided to the participant, so they can respond
|
|
37
|
-
when positioned further than an arm's length away from the experiment computer.
|
|
38
|
-
|
|
39
|
-
Increasingly so, these types of experiments are being run remotely,
|
|
40
|
-
in participants' homes, by participants recruited on platforms such as
|
|
41
|
-
[MTurk](https://en.wikipedia.org/wiki/Criticism_of_Amazon)
|
|
42
|
-
or [Prolific](https://www.prolific.co).
|
|
43
|
-
Under the presumption that smartphones are more
|
|
44
|
-
generally available than wireless, Bluetooth keyboards, this utlility
|
|
45
|
-
emulates a wireless keyboard on any internet-connected smartphone.
|
|
1
|
+
# Virtual Keypad
|
|
2
|
+
|
|
3
|
+
Spawn and communicate with a virtual keypad, eg for use in online psychology
|
|
4
|
+
experiments.
|
|
5
|
+
|
|
6
|
+
This client-side module creates a QR Code linking to the appropriately
|
|
7
|
+
specified keypad, handle's a user-defined callback on the incoming data,
|
|
8
|
+
and allows for real-time changes to the keypad content.
|
|
9
|
+
|
|
10
|
+
## How
|
|
11
|
+
**tl;dr** instantiate a `Receiver`, eg from within a PsychoJS experiment,
|
|
12
|
+
and scan the generated QR Code from your mobile device. By default the user
|
|
13
|
+
is taken to a publically-hosted webpage wrapper around `Keypad`.
|
|
14
|
+
Use the `keypadURL` parameter of `Receiver` to instead direct
|
|
15
|
+
the user to a keypad hosted elsewhere.
|
|
16
|
+
|
|
17
|
+
### Receiver
|
|
18
|
+
Most users, eg experimenters, should only need to use the `Receiver` class.
|
|
19
|
+
This class handles configuring the content of the keypad (ie what symbols to
|
|
20
|
+
show, and in what font face), creates a link -- in the form of a QR code -- to
|
|
21
|
+
a keypad for the user to use.
|
|
22
|
+
|
|
23
|
+
## What
|
|
24
|
+
A simple (optionally self-hosted) keypad webapp, with user-specified callback behavior.
|
|
25
|
+
Built using [PeerJS](https://www.npmjs.com/package/peerjs) and [QRCode](https://www.npmjs.com/package/qrcode).
|
|
26
|
+
|
|
27
|
+
## Why
|
|
28
|
+
In [Denis Pelli's NYU psychology lab](https://denispelli.com),
|
|
29
|
+
we carry out a lot of psychophysical experiments. For example,
|
|
30
|
+
we may want to
|
|
31
|
+
[measure a participant's crowding](https://www.biorxiv.org/content/10.1101/2021.04.12.439570v1),
|
|
32
|
+
so we can investigate the possibility of a
|
|
33
|
+
[link between crowding performance and the size of the participants hV4](https://jov.arvojournals.org/article.aspx?articleid=2749904) region of the visual cortex.
|
|
34
|
+
These experiments often involve the participant responding to stimuli
|
|
35
|
+
with a keypress. If the task requires a long viewing distance, a
|
|
36
|
+
wireless keyboard is provided to the participant, so they can respond
|
|
37
|
+
when positioned further than an arm's length away from the experiment computer.
|
|
38
|
+
|
|
39
|
+
Increasingly so, these types of experiments are being run remotely,
|
|
40
|
+
in participants' homes, by participants recruited on platforms such as
|
|
41
|
+
[MTurk](https://en.wikipedia.org/wiki/Criticism_of_Amazon)
|
|
42
|
+
or [Prolific](https://www.prolific.co).
|
|
43
|
+
Under the presumption that smartphones are more
|
|
44
|
+
generally available than wireless, Bluetooth keyboards, this utlility
|
|
45
|
+
emulates a wireless keyboard on any internet-connected smartphone.
|
package/dist/404.html
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width" />
|
|
6
|
-
<title>Virtual Keypad</title>
|
|
7
|
-
<meta name="description" content="" />
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<h1>Uh oh! 404 error</h1>
|
|
12
|
-
<h3>Page not found.</h3>
|
|
13
|
-
</body>
|
|
14
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width" />
|
|
6
|
+
<title>Virtual Keypad</title>
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<h1>Uh oh! 404 error</h1>
|
|
12
|
+
<h3>Page not found.</h3>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|