| 47 | | |
| 48 | | |
| 49 | | # Netscape 6.1 have forgotten how to scroll backwards with the backspace |
| 50 | | # key. Relearn it, using the XTEST extension. Oops: naturally this also |
| 51 | | # affected backspace in text edit fields. Disable entirely until this |
| 52 | | # can be fixed... |
| 53 | | |
| 54 | | class MozillaKeys(keys.KeyHandler): |
| 55 | | def __init__(self, obj): |
| 56 | | keys.KeyHandler.__init__(self, obj) |
| 57 | | self.pageup_code = self.wm.display.keysym_to_keycode(XK.XK_Prior) |
| 58 | | |
| 59 | | # Disabled for now, as the grabbing means that the faked input will go |
| 60 | | # back to us and not to the Netscape window. Therefore, only generate |
| 61 | | # event at KeyRelease until I figure out a way around this. |
| 62 | | |
| 63 | | # def Any_BackSpace(self, evt): |
| 64 | | # if self.pageup_code: |
| 65 | | # self.wm.display.xtest_fake_input(X.KeyPress, self.pageup_code) |
| 66 | | |
| 67 | | def R_Any_BackSpace(self, evt): |
| 68 | | if self.pageup_code: |
| 69 | | self.wm.display.xtest_fake_input(X.KeyPress, self.pageup_code) |
| 70 | | self.wm.display.xtest_fake_input(X.KeyRelease, self.pageup_code, 5) |
| 71 | | |
| 72 | | class TeachMozillaBackspace: |
| 73 | | def __client_init__(self): |
| 74 | | if self.res_class == 'Mozilla-bin': |
| 75 | | MozillaKeys(self) |
| 76 | | |
| 77 | | |
| 78 | | class MyMozillaPopupKeymap(misc.MozillaPopupKeymap): |
| 79 | | M5_a = misc.MozillaPopupKeymap._accept |
| 80 | | _key_name = 'M5-a' |