Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear events before getting key presses in inquiry preview #216

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The details (incomplete, our apologies!):
- `CODE_OF_CONDUCT.md`: to latest version of the Contributor Covenant
- `README.md`: Add new glossary terms: mode, session and task #126 #127 and cleanup #129
- `bcipy/main.py`: formally, `bci_main.py`. To give a better console entry point and infrastructure for integration testing. In the terminal, you can now run `bcipy` instead of `python bci_main.py`
- `parameters.json`: add stim_order #153 add max selections #175 remove max_inq_per_trial in favor of max_inq_per_series #176 add inquiry preview #177
- `parameters.json`: add stim_order #153 add max selections #175 remove max_inq_per_trial in favor of max_inq_per_series #176 add inquiry preview #177 with relevant stimuli units in help text, better starting stim_height, and inquiry preview keys #216
- `demo_stimuli_generation.py`: update imports and add a case showing the new ordering functionality. #153
- `copy_phrase_wrapper`: update logging and exception handling. add stim order. #153 BUGFIX: return transformed sampling rate #159
- `random_rsvp_calibration_inq_gen`: rename to `calibration_inquiry_generator` #153
Expand Down
3 changes: 2 additions & 1 deletion bcipy/display/paradigm/rsvp/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os.path as path
from typing import List, Optional, Tuple

from psychopy import core, visual
from psychopy import core, visual, event

from bcipy.helpers.clock import Clock
from bcipy.helpers.task import SPACE_CHAR, get_key_press
Expand Down Expand Up @@ -243,6 +243,7 @@ def preview_inquiry(self) -> Tuple[List[float], bool]:
timer = core.CountdownTimer(self._preview_inquiry.preview_inquiry_length)
response = False

event.clearEvents(eventType='keyboard')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad this was a straightforward fix.

while timer.getTime() > 0:
# wait for a key press event
response = get_key_press(
Expand Down
21 changes: 11 additions & 10 deletions bcipy/parameters/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@
"value": "500",
"section": "bci_config",
"readableName": "Task Window Height",
"helpTip": "Specifies the height (in pixels) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). Default: 500",
"helpTip": "Specifies the height (in norm units) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). See https://www.psychopy.org/general/units.html. Default: 500",
"recommended_values": "",
"type": "int"
},
"window_width": {
"value": "500",
"section": "bci_config",
"readableName": "Task Window Width",
"helpTip": "Specifies the width (in pixels) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). Default: 500",
"helpTip": "Specifies the width (in norm units) of the task window when not in full screen mode (Full Screen Mode On/Off must be set to ‘false’). See https://www.psychopy.org/general/units.html. Default: 500",
"recommended_values": "",
"type": "int"
},
Expand Down Expand Up @@ -442,10 +442,10 @@
"type": "str"
},
"stim_height": {
"value": "0.6",
"value": "0.5",
"section": "bci_config",
"readableName": "Stimulus Size",
"helpTip": "Specifies the height (in ???) of text stimuli. Possible values range from X to X. Default: 0.6",
"helpTip": "Specifies the height of text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.5",
"recommended_values": "",
"type": "float"
},
Expand Down Expand Up @@ -532,8 +532,8 @@
"info_height": {
"value": "0.1",
"section": "bci_config",
"readableName": "Text Height",
"helpTip": "Text Height",
"readableName": "Text below main presentation height",
"helpTip": "Specifies the height of iinfo text stimuli. See https://www.psychopy.org/general/units.html. Default: 0.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra 'i' in there.

"recommended_values": [
"0.1"
],
Expand Down Expand Up @@ -603,7 +603,7 @@
"value": "0.1",
"section": "bci_config",
"readableName": "Task Text Size",
"helpTip": "Specifies the height (in ???) of task-specific text, e.g. #/100 in calibration and target phrase in copy/spelling. Possible values range from 0 to 1. Default: 0.1",
"helpTip": "Specifies the height of task-specific text, e.g. #/100 in calibration and target phrase in copy/spelling. See https://www.psychopy.org/general/units.html. Default: 0.1",
"recommended_values": [
"0.1"
],
Expand Down Expand Up @@ -811,13 +811,14 @@
"type": "float"
},
"preview_inquiry_key_input": {
"value": "space",
"value": "return",
"section": "bci_config",
"readableName": "Preview Inquiry Display Key Input Method",
"helpTip": "Defines the key used to engage with inquiry preview.",
"recommended_values": [
"space",
"escape"
"escape",
"return"
],
"type": "str"
},
Expand Down Expand Up @@ -873,7 +874,7 @@
"value": "0.2",
"section": "feedback_config",
"readableName": "Feedback Stimuli Height",
"helpTip": "Specifies the height of the feedback stimuli. Default: 0.2",
"helpTip": "Specifies the height of the feedback stimuli. See https://www.psychopy.org/general/units.html. Default: 0.2",
"recommended_values": "",
"type": "float"
},
Expand Down