import gtk
import locale


class NumericEntry(gtk.Entry):
    __gsignals__ = {'key_press_event': 'override'}

def do_key_press_event(self, event):
    if event.keyval == gtk.gdk.keyval_from_name('KP_Decimal'):
        pass
How to transform a key pressed into a different one in pygtk