Hi Winkleink,

Thanks for the hint. Indeed I heard/read somewhere that joysticks events are working. But keyboard events somehow not. I cut an pasted a bit from your code and came up with the testprogramm below. If you run it, the joystick will trigger events, but the keyboard doesn't
------------------------
import pygame, os, sys
from pygame import locals

os.environ['SDL_VIDEODRIVER'] = 'dummy'
pygame.init()
pygame.joystick.init()

try:
   j = pygame.joystick.Joystick(0) # create a joystick instance
   j.init() # init instance
   print 'Enabled joystick: ' + j.get_name()
except pygame.error:
   print 'no joystick found.'

while True:
  for event in pygame.event.get():
    print 'event detected'
    if event.type == pygame.QUIT:
      sys.exit()
    if event.type == pygame.KEYDOWN:
      print 'key pressed'
if event.type == pygame.locals.JOYAXISMOTION: # Read Analog Joystick Axis
       print 'joystick moved'
---------------------------------------------


On 27/03/16 12:53, Winkleink wrote:
I use dummy in the following project and it worked.
There may be something other than that one line that needs to be sorted.


http://winkleink.blogspot.co.uk/2013/04/raspberry-pi-unipolar-stepper-motors.html
On Sun, 27 Mar 2016 at 08:03, Bert Haverkamp <b...@bertenselena.net <mailto:b...@bertenselena.net>> wrote:

    Hello all,

    Maybe it has been asked before. But I only see older posts on this
    topic. I'm hoping the situation has changed now.
    I'm trying to make a game where there is no screen needed, but
    physical actuators (motors, steppers, a beeper)

    But without a screen defined, I cannot seem to get events to work
    properly
    In particular cannot use the keydown and keyup events. The events
    don't seem to happen.

    I read somewhere that I should use the dummy screen with

    os.environ['SDL_VIDEODRIVER']  ='dummy'

    But this also doesn't seem to help.
    Is there a way to get the events functioning without a screen? If
    so, how. If not, would that be an possible addition in a future
    version?

    Regards,

    Bert


Reply via email to