Rob Shortt wrote:
> In src/eveny.py we do "import pygame.locals as key" and setup
> DEFAULT_KEYMAP as a dictionary keyed by lots of key.* members.  Inside
> freevo_config.py we do KEYMAP = DEFAULT_KEYMAP and access this
> elsewhere as config.KEYMAP.
>
> I would like to remove the pygame reference from src/event.py and
> therefore rearrange where DEFAULT_KEYMAP and KEYMAP are defined.  In
> rc.py there is a class for attaching keyboard callbacks but I don't
> think that is a good spot for it either.  The only other pygame code
> is in src/gui/ but that is for display right?  Well, the keyboard
> callback for pygame is actually attached there.
>
> I don't really know what should be done here.  Dischi, perhaps you
> already have plans for this?

No, I'm not sure were the keyboard stuff could go. We need pygame only
to get the keycode mappings. Not very good. Other backends like ivtv
or bmovl2 don't even have keyboard support. 

Right now, the keyboard ocde in rc.py is only a dummy and should be
moved to a different position. It should be the following code: when
you activate a display engine like pygame, it should be able to send
inputs like keys to the eventhandler. Other displays may do the same,
other don't do it (because they don't support keyboards). 

The big questions here: were to define the keymap? We could define the
keymap inside sdl.py, but if pydfb also supports keyboard input, you
need to define the map twice. But if we add pygame.locals to event
and/or main, we get into problems. I have no idea for a good solution
to solve this. Also it should be possible for the user in his
local_conf.py to redefine keyboard control. Maybe define a key code
table of our own?

> -Make a src/input/ directory and abstract the input sources there,
> similar to how src/gui/displays abstracts the display.
>
> -Make all input come from plugins: input_pygame, input_lirc,
> input_evdev, input_mouse (lol), input_pydfb, input_kb (direct kb
> interface without pygame perhaps).
>

Don't know, the keyboard control is bound to the display. You couldn't
use pygame keyboard + ivtv display or dfb keyboard + pygame.

> -just move the pygame input into the sdl display module, if you're not
> using pygame then input will come from a plugin (evdev, lirc, etc),
> ie: still use other plugins for input.

Each display can provide an input.


Dischi

-- 
2 + 2 = 5  for sufficiently large values of 2.


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to