[visionegg] Re: collecting keyboard input
- From: Mark Halko <mhalko@xxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Tue, 9 May 2006 17:42:10 -0400
Alessandro -
Visionegg is based on Pygame and is a library for python, so anything
you can program, you can do in Visionegg. I haven't used PyEPL, so I
really don't know how that experience compares to Visionegg.
It shouldn't be too difficult to make the subject's response show up on
the screen as they type it. You will have to program it yourself,
however, as visionegg doesn't have a specific class for handling such
cases. You'll want to look at the Text class (as Chao Tang pointed
out). Essentially, you'll have to read the keypresses with a handler
and change the text parameter of a Text class object.
Check out the demos: displayText.py shows how to display text,
gamma.py shows how to handle responses with pygame, or you can look
into using demo_keyboardresponse.py.
The best way to try visionegg is to install it and get your feet wet
with the demos. Once you get an idea of how they work, you can look at
the library reference, which will help you the most. If you really
need to figure something out, check out the source, it's the advantage
of using an open source project to program your stimuli.
Demos:
from http://www.visionegg.org/Download_and_Install :
http://prdownloads.sourceforge.net/visionegg/visionegg-1.0-
demos.tar.gz?download
Library Reference:
http://visionegg.org/reference/index.html
Source (you'll install it, so you have your own copy, but you can look
at the current version here):
http://visionegg.org/cgi-bin/viewcvs.cgi/trunk/visionegg
Pygame.event docs may be relevant, particularly keydown:
http://www.pygame.org/docs/ref/event.html
Mark
On May 9, 2006, at 4:19 PM, Alessandro Gagliardi wrote:
I haven't touched Vision Egg yet, so forgive me my ignorant questions
but: how hard would it be to echo that input on the screen? I ask
because in PyEPL (which I have been using), to repeatedly update the
screen with every key press is a bit of a pain. It's not like you can
have a textbox with the input fed from the keyboard, like you might be
able to in other systems. How is it in Vision Egg? (And for the
record, I did take a look at the documentation on the website and I
didn't see anything about tracking key presses. Though perhaps I
didn't look hard enough.)
Thanks!
-Alessandro
On 5/9/06, Chao Tang <tang@xxxxxxxxxxx> wrote:Hi,
You may use pygame.event to get what you want...see code snap bellow.
import pygame
# get one key press
for event in pygame.event.get():
# event.type and event.key are ready for you to use
if event.type == pygame.KEYDOWN:
...
if event.type == pygame.KEYUP:
...
HTH.
Chao
-----Original Message-----
From: visionegg-bounce@xxxxxxxxxxxxx
[mailto:visionegg-bounce@xxxxxxxxxxxxx]On Behalf Of Alessandro
Gagliardi
Sent: Tuesday, May 09, 2006 3:09 PM
To: visionegg@xxxxxxxxxxxxx
Subject: [visionegg] collecting keyboard input
Hello Vision Egg users,
I'm currently designing an experiment in which I want to collect
keyboard input from a participant typing one word answers to
questions. Obviously, I would like their input echoed on the
screen. Is there an easy way to do this with Vision Egg? There is
no way in the software that I'm currently using, so I'm thinking of
switching.
Thanks in advance,
--
Alessandro Gagliardi
Integrative Neuroscience
Rutgers University
alessandro@xxxxxxxxxxxxxx
--
Alessandro Gagliardi
Integrative Neuroscience
Rutgers University
alessandro@xxxxxxxxxxxxxx
=====================================The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- References:
- [visionegg] collecting keyboard input
- From: Alessandro Gagliardi
- [visionegg] Re: collecting keyboard input
- From: Chao Tang
- [visionegg] Re: collecting keyboard input
- From: Alessandro Gagliardi
Other related posts:
- » [visionegg] collecting keyboard input
- » [visionegg] Re: collecting keyboard input
- » [visionegg] Re: collecting keyboard input
- » [visionegg] Re: collecting keyboard input
- » [visionegg] Re: collecting keyboard input
- » [visionegg] Re: collecting keyboard input
Thanks! -Alessandro
On 5/9/06, Chao Tang <tang@xxxxxxxxxxx> wrote:Hi,
You may use pygame.event to get what you want...see code snap bellow. import pygame # get one key press for event in pygame.event.get(): # event.type and event.key are ready for you to use if event.type == pygame.KEYDOWN: ... if event.type == pygame.KEYUP: ... HTH.
Chao
-----Original Message-----
From: visionegg-bounce@xxxxxxxxxxxxx [mailto:visionegg-bounce@xxxxxxxxxxxxx]On Behalf Of Alessandro Gagliardi
Sent: Tuesday, May 09, 2006 3:09 PM
To: visionegg@xxxxxxxxxxxxx
Subject: [visionegg] collecting keyboard input
Hello Vision Egg users,
I'm currently designing an experiment in which I want to collect keyboard input from a participant typing one word answers to questions. Obviously, I would like their input echoed on the screen. Is there an easy way to do this with Vision Egg? There is no way in the software that I'm currently using, so I'm thinking of switching.
Thanks in advance, -- Alessandro Gagliardi Integrative Neuroscience Rutgers University alessandro@xxxxxxxxxxxxxx
-- Alessandro Gagliardi Integrative Neuroscience Rutgers University alessandro@xxxxxxxxxxxxxx
- [visionegg] collecting keyboard input
- From: Alessandro Gagliardi
- [visionegg] Re: collecting keyboard input
- From: Chao Tang
- [visionegg] Re: collecting keyboard input
- From: Alessandro Gagliardi