Roh . wrote:
hi all,
im trying to get freevo to use the numeric keypad.
ive tried:
KEYMAP[K_2] = 'UP'
KEYMAP[K_8] = 'DOWN'
and
KEYMAP[K_2] = 'MENU_UP'
KEYMAP[K_8] = 'MENU_DOWN'
and
EVENTS['menu']['2'] = EVENT('UP')
EVENTS['menu']['8'] = EVENT('DOWN')
and
EVENTS['menu']['2'] = EVENT('MENU_UP')
EVENTS['menu']['8'] = EVENT('MENU_DOWN')

in local_conf.py, but with no luck at all.
Is there something im missing?
Does anyone have an example local_conf.py with custom keys setup?

cheers,
rohbags.


There are some examples in item #19 of the FAQ, however it only shows how to assign keybindings to known keys. The actual setup is in events.py, where all the possible inputs in a given context are defined. Someone will hopefully correct me if I'm wrong here, but at the moment you need to add new keys to events.py if you wish to use them - for instance, to add the '0' on the numpad you add to the DEFAULT_KEYMAP list an item key.K_KP_0 : 'n_0'. Then you can assign an action to the 'n_0' key in your local_conf.py.

It's a hassle, I know, and it needs to be manually added back when you update freevo, but hopefully someone will either show a better way (if one exists) or change freevo to read the keymap from local_conf.py.

--
Ole Andre

Thanks for the hand, im on the right track now but it still wont work! there must be somewhere else freevo/python defines its keys.

if i add to event.py
K_KP_2     :'n_0'
or
K_KP_2     :'UP'  # i want 2 to be same as UP arrow key

i get an error like this:
[EMAIL PROTECTED] freevo-1.4.1]# ./freevo
Traceback (most recent call last):
File "./src/main.py", line 82, in ?
import mmpython
File "/opt/freevo-1.4.1/runtime/lib/python2.3/site-packages/mmpython/__init__.py", line 101, in ?
import disc.dvdinfo
File "/opt/freevo-1.4.1/runtime/lib/python2.3/site-packages/mmpython/disc/dvdinfo.py", line 35, in ?
import config
File "/opt/freevo-1.4.1/src/config.py", line 432, in ?
execfile(os.environ['FREEVO_CONFIG'], globals(), locals())
File "./freevo_config.py", line 100, in ?
import plugin
File "/opt/freevo-1.4.1/src/plugin.py", line 69, in ?
from event import Event
File "/opt/freevo-1.4.1/src/event.py", line 482, in ?
DEFAULT_KEYMAP = {
NameError: name 'K_KP_2' is not defined


..so freevo only accepts already defined keys like K_F1 or K_HOME or K_KP_MINUS, where are these keys defined? how can i change/add to them? where can i set K_KP_2 to a specific scancode or keycode?

playing with event.py lets me change K_2 and K_8 to UP & DOWN events, but K_2 and K_8 are only for the normal numeric keys, not the keypad, so i guess the KP in K_KP_MINUS is for keypad, but K_KP_*anything* wont work except fot K_KP_MINUS and K_KP_PLUS :(

any help would be more than welcomed!

rohbags.

_________________________________________________________________
Check out MSN PC Safety & Security to help ensure your PC is protected and safe. http://specials.msn.com/msn/security.asp




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freevo-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to