File: test_input_pad_gtk.py

package info (click to toggle)
input-pad 1.0.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,220 kB
  • sloc: sh: 11,468; ansic: 8,465; python: 860; makefile: 461
file content (37 lines) | stat: -rwxr-xr-x 1,159 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python

import os, sys
import gtk
import input_pad
from input_pad_window_gtk import InputPadGtkWindow, get_kbdui_name_list

def button_pressed_cb(window, str, type, keysym, keycode, state, data):
    print "str =", str
    print "type =", type
    print "keysym =", keysym
    print "keycode =", keycode
    print "state =", state
    print "data =", data

input_pad.init()
print "available kbdui modules:", get_kbdui_name_list()
window = InputPadGtkWindow (gtk.WINDOW_TOPLEVEL)
if len(sys.argv) > 1:
    if os.path.isdir(sys.argv[1]):
        print "paddir", sys.argv[1]
        window.set_paddir(sys.argv[1])
    elif os.path.isfile(sys.argv[1]):
        print "padfile", sys.argv[1]
        window.append_padfile(sys.argv[1])
#window.set_kbdui_name("eek-gtk")
window.show()
#window.set_show_table(0)
#window.set_show_layout(0)
window.set_char_button_sensitive(True)
window.connect("button-pressed", button_pressed_cb)
window.reorder_button_pressed()
print "input-pad visible?", window.get_visible()
## XK_Shift_L from X11/keysymdef.h
#window.set_keyboard_state_with_keysym(0xffe1)
print "keyboard_state?", window.get_keyboard_state()
gtk.main()