mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
remove keyCode-related functions from pluginAPI docs #396
This commit is contained in:
parent
72af0b870f
commit
1f16ed1ee6
@ -117,100 +117,6 @@ Returns nothing.
|
||||
|
||||
Clears any pending timeouts that were set using jsPsych.pluginAPI.setTimeout()
|
||||
|
||||
---
|
||||
## jsPsych.pluginAPI.compareKeys
|
||||
|
||||
```
|
||||
jsPsych.pluginAPI.compareKeys(key1, key2)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Parameter | Type | Description
|
||||
----------|------|------------
|
||||
key1 | string or numeric | The representation of a key, either string or keycode
|
||||
key2 | string or numeric | The representation of a key, either string or keycode
|
||||
|
||||
### Return value
|
||||
|
||||
Returns true if keycodes or strings refer to the same key, regardless of type.
|
||||
|
||||
### Description
|
||||
|
||||
Compares two keys to see if they are the same, ignoring differences in representational type.
|
||||
|
||||
### Examples
|
||||
|
||||
```javascript
|
||||
jsPsych.pluginAPI.compareKeys('a', 65);
|
||||
// returns true
|
||||
|
||||
jsPsych.pluginAPI.compareKeys('space', 31)
|
||||
// returns false
|
||||
```
|
||||
|
||||
---
|
||||
## jsPsych.pluginAPI.convertKeyCharacterToKeyCode
|
||||
|
||||
```
|
||||
jsPsych.pluginAPI.convertKeyCharacterToKeyCode(character)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Parameter | Type | Description
|
||||
----------|------|------------
|
||||
character | string | The string representation of keyboard key.
|
||||
|
||||
### Return value
|
||||
|
||||
Returns the numeric keycode associated with the `character` parameter.
|
||||
|
||||
### Description
|
||||
|
||||
Converts between the string representation of a key and the numeric key code associated with that key.
|
||||
|
||||
### Examples
|
||||
|
||||
```javascript
|
||||
var keycode = jsPsych.pluginAPI.convertKeyCharacterToKeyCode('a')
|
||||
// keycode is 65
|
||||
|
||||
keycode = jsPsych.pluginAPI.convertKeyCharacterToKeyCode('space')
|
||||
// keycode is 32
|
||||
```
|
||||
|
||||
---
|
||||
## jsPsych.pluginAPI.convertKeyCodeToKeyCharacter
|
||||
|
||||
```
|
||||
jsPsych.pluginAPI.convertKeyCodeToKeyCharacter(character)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Parameter | Type | Description
|
||||
----------|------|------------
|
||||
code | numeric | The numeric representation of keyboard key.
|
||||
|
||||
### Return value
|
||||
|
||||
Returns the string representation of the key associated with the `code` parameter.
|
||||
|
||||
### Description
|
||||
|
||||
Converts between the numeric key code of a key and the string representation associated with that key.
|
||||
|
||||
### Examples
|
||||
|
||||
```javascript
|
||||
var keycode = jsPsych.pluginAPI.convertKeyCharacterToKeyCode(65)
|
||||
// key is 'a'
|
||||
|
||||
keycode = jsPsych.pluginAPI.convertKeyCharacterToKeyCode(32)
|
||||
// keycode is 'space'
|
||||
```
|
||||
|
||||
---
|
||||
## jsPsych.pluginAPI.getAudioBuffer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user