paraplegicpanda - 2010-03-25

OS: Ubuntu 8.10 Karmic Koala, fully updated

I've got an old Nostromo n50 speedpad that I decided I wanted to try to get to work with WoW. I have looked into the Nostromo Linux drivers and Pystromo, but I decided to dip my toes into Python with Gizmo Daemon because I should
be able to use it for other gamepads in the future. I'm not exactly sure what the problem is but any help would be greatly appreciated. Here's what I've done so far:

  1. Installed GizmoD from Synaptic.

  2. Read through the tutorials and HOWTOs on the website.

  3. Used gizmod -g to record the input from my Nostromo n50.

  4. Attempted to modify a GizmoD map file to do what I wanted.

Up until the last part everything has been going fine. Here's the mapping of my input keys:

Key 01 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90001
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_A> c: 0x130 v: 0x1
Key 01 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90001
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_A> c: 0x130 v: 0x0
Key 02 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90002
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_B> c: 0x131 v: 0x1
Key 02 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90002
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_B> c: 0x131 v: 0x0
Key 03 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90003
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_C> c: 0x132 v: 0x1
Key 03 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90003
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_C> c: 0x132 v: 0x0
Key 04 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90004
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_X> c: 0x133 v: 0x1
Key 04 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90004
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_X> c: 0x133 v: 0x0
Key 05 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90005
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_Y> c: 0x134 v: 0x1
Key 05 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90005
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_Y> c: 0x134 v: 0x0
Key 06 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90006
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_Z> c: 0x135 v: 0x1
Key 06 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90006
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_Z> c: 0x135 v: 0x0
Key 07 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90007
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TL> c: 0x136 v: 0x1
Key 07 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90007
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TL> c: 0x136 v: 0x0
Key 08 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90008
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TR> c: 0x137 v: 0x1
Key 08 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90008
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TR> c: 0x137 v: 0x0
Key 09 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90009
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TL2> c: 0x138 v: 0x1
Key 09 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x90009
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TL2> c: 0x138 v: 0x0
Key 10 Press
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x9000a
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TR2> c: 0x139 v: 0x1
Key 10 Release
onEvent: Standard -- /dev/input/event3 | [EV_MSC] c: 0x4 Val: 0x9000a
onEvent: Standard -- /dev/input/event3 | [EV_KEY] <BTN_TR2> c: 0x139 v: 0x0
DPAD Up
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x1 Val: 0x0
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x1 Val: 0x80
DPAD Down
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x1 Val: 0xff
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x1 Val: 0x80
DPAD Left
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x0 Val: 0x0
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x0 Val: 0x80
DPAD Right
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x0 Val: 0xff
onEvent: Standard -- /dev/input/event3 | [EV_ABS] c: 0x0 Val: 0x80

The last four keys are commented out in my map file for the moment since I'm not quite sure how to do them. I just want keys 01-10 to translate into my normal keyboard keys 1-9 and 0. The DPAD I want to translate into a normal WASD for gaming. I'm kind of stumped as to where to go from here. I run gizmod from a terminal, but it doesn't seem to work.

#***
  #*********************************************************************
#*************************************************************************
#*** 
#*** GizmoDaemon Config Script
#***    Nostromo Speedpad n50 config
#***
#*****************************************
  #*****************************************
#***
"""
  Copyright (c) 2007, Gizmo Daemon Team
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at 
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and 
  limitations under the License. 
  
"""
############################
# Imports
##########################
from GizmoDaemon import *
from GizmoScriptDefault import *
import subprocess
ENABLED = True
VERSION_NEEDED = 3.2
INTERESTED_CLASSES = [GizmoEventClass.Standard]
############################
# KeyboardWoW Class definition
##########################
class KeyboardWoW(GizmoScriptDefault):
    """
    Nostromo Speedpad n50 Event Mapping
    """

    ############################
    # Public Functions
    ##########################

    def onDeviceEvent(self, Event, Gizmo = None):
        """
        Called from Base Class' onEvent method.
        See GizmodDispatcher.onEvent documention for an explanation of this function
        """

        # process the key
#01---------------
        if   Event.Button == "BTN_A":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_1)
            return True
#02---------------
        elif Event.Button == "BTN_B":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_2)
            return True
#03---------------
        elif Event.Button == "BTN_C":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_3)
            return True
#04---------------
        elif Event.Button == "BTN_X":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_4)
            return True
#05---------------
        elif Event.Button == "BTN_Y":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_5)
            return True
#06---------------
        elif Event.Button == "BTN_Z":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_6)
            return True
#07---------------
        elif Event.Button == "BTN_TL":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_7)
            return True
#08---------------
        elif Event.Button == "BTN_TR":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_8)
            return True
#09---------------
        elif Event.Button == "BTN_TL2":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_9)
            return True
#10---------------
        elif Event.Button == "BTN_TR2":
            Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_0)
            return True
# DPAD UP---------
#       elif Event.Button == "?????":
#           Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_W)
#           return True
# DPAD DOWN-------
#       elif Event.Button == "?????":
#           Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_S)
#           return True
# DPAD LEFT-------
#       elif Event.Button == "?????":
#           Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_A)
#           return True
# DPAD RIGHT------
#       elif Event.Button == "?????":
#           Gizmod.Keyboards[0].createEventPress(GizmoEventType.EV_KEY, GizmoKey.KEY_D)
#           return True
        else:
            # unmatched event, keep processing
            return False
        # event not of interest
        return False

    ############################
    # Private Functions
    ##########################
    def __init__(self):
        """ 
        Default Constructor
        """

        GizmoScriptDefault.__init__(self, ENABLED, VERSION_NEEDED, INTERESTED_CLASSES)
############################
# KeyboardWoW class end
##########################
# register the user script
KeyboardWoW()

Once again, I appreciate any help!