[visionegg] Re: collecting keyboard input

Can you update your string between frames? Something like...

screen = get_default_screen()
text = Text(text = 'string',
      position = (screen.size[0]/2,screen.size[1]/2),    #display at the
center
      anchor = 'bottom',
      color = (1.0,1.0,0.0))

while done != 1:
  screen.clear()
  text.parameters.text = 'newer string';  #update your string here
  viewport.parameters.stimuli = [text]
  viewport.draw()
  swap_buffers()


 HTH.

Chao


-----Original Message-----
From: visionegg-bounce@xxxxxxxxxxxxx
[mailto:visionegg-bounce@xxxxxxxxxxxxx]On Behalf Of Alessandro Gagliardi
Sent: Tuesday, May 09, 2006 4:19 PM
To: visionegg@xxxxxxxxxxxxx
Subject: [visionegg] Re: collecting keyboard input


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

Other related posts: