summaryrefslogtreecommitdiff
path: root/caribou/common/const.py
blob: ecb61da7c3465db9318daf54e95f0fd82931c89c (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- coding: utf-8 -*-
#
# Caribou - text entry and UI navigation application
#
# Copyright (C) 2010 Warp Networks S.L.
#  * Contributor: David Pellicer <dpellicer@warp.es>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

from os.path import join
from os.path import dirname

import gtk
from caribou import data_path

# Application name
APP_NAME = 'Caribou'
APP_SLUG_NAME = 'caribou'

# Paths
DATA_DIR = data_path
KEYBOARDS_DIR = join(DATA_DIR, 'keyboards')

# Preferences
CARIBOU_GCONF = join('/apps', 'caribou', 'osk')

# Key types
NORMAL_KEY_TYPE = 'normal'
LAYOUT_SWITCHER_KEY_TYPE = 'layout_switcher'
PREFERENCES_KEY_TYPE = 'preferences'
DUMMY_KEY_TYPE = 'dummy'
MASK_KEY_TYPE = 'mask'

KEY_MASKS = {'shift': gtk.gdk.SHIFT_MASK,
             'lock': gtk.gdk.LOCK_MASK,
             'control': gtk.gdk.CONTROL_MASK,
             'mod1': gtk.gdk.MOD1_MASK,
             'mod2': gtk.gdk.MOD2_MASK,
             'mod3': gtk.gdk.MOD3_MASK,
             'mod4': gtk.gdk.MOD4_MASK,
             'mod5': gtk.gdk.MOD5_MASK,
             'button1': gtk.gdk.BUTTON1_MASK,
             'button2': gtk.gdk.BUTTON2_MASK,
             'button3': gtk.gdk.BUTTON3_MASK,
             'button4': gtk.gdk.BUTTON4_MASK,
             'button5': gtk.gdk.BUTTON5_MASK}

# Scan constans
BUTTON = 'button'
ROW = '1'
BLOCK = '0'
CANCEL = 'cancel'
REVERSE = 'reverse'
MOUSE_SWITCH_TYPE = 'mouse'
KEYBOARD_SWITCH_TYPE = 'keyboard'
KEYBOARD_KEY_LIST = {"Shift R" : "Shift_R",
                     "Shift L" : "Shift_L", 
                     "Alt Gr"  : "ISO_Level3_Shift",
                     "Num Lock": "Num_Lock"}
DEFAULT_KEYBOARD_KEY = 'Shift R'
DEFAULT_MOUSE_BUTTON = '1'
MIN_STEP_TIME = 50
MAX_STEP_TIME = 5000
TIME_SINGLE_INCREMENT = 1
TIME_MULTI_INCREMENT = 10
DEFAULT_STEP_TIME = 1000
DEFAULT_SCANNING_TYPE = ROW
DEFAULT_SWITCH_TYPE = KEYBOARD_SWITCH_TYPE