event-input.h 4.51 KB
Newer Older
1 2 3 4
/**
 * @file event-input.h
 * Headers for the /dev/input event provider for the Mode Control Entity
 * <p>
Santtu Lakkala's avatar
Santtu Lakkala committed
5
 * Copyright © 2007-2011 Nokia Corporation and/or its subsidiary(-ies).
6
 * Copyright (C) 2013-2019 Jolla Ltd.
7 8
 * <p>
 * @author David Weinehall <david.weinehall@nokia.com>
9 10
 * @author Santtu Lakkala <ext-santtu.1.lakkala@nokia.com>
 * @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * mce is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * mce 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 mce.  If not, see <http://www.gnu.org/licenses/>.
 */
24 25
#ifndef EVENT_INPUT_H_
# define EVENT_INPUT_H_
26

27 28 29 30 31
# include <glib.h>

/* ========================================================================= *
 * Constants
 * ========================================================================= */
32 33

/** Path to the input device directory */
34
# define DEV_INPUT_PATH                 "/dev/input"
35

36
/** Prefix for event files */
37
# define EVENT_FILE_PREFIX              "event"
38

39
/** Path to the GPIO key disable interface */
40 41
# define GPIO_KEY_DISABLE_PATH          "/sys/devices/platform/gpio-keys/disabled_keys"

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
/** Name of the evdev event mapping configuration group
 *
 * This configuration group can be used to remap the events
 * sent by the kernel to the ones expected by mce.
 *
 * Items in the group are of form:
 *
 * <event_emitted_by_kernel>=<event_expected_by_mce>
 *
 * Where both event_emitted_by_kernel and event_expected_by_mce are event
 * code names such: as SW_LID, SW_KEYPAD_SLIDE, ...
 *
 * See inifiles/evdev.ini for details and examples.
 */
#define MCE_CONF_EVDEV_GROUP            "EVDEV"

/** Name of the evdev type configuration group
 *
 * This configuration group can be used to explicitly define input device
 * types in cases where probing heuristic in mce code fails to work.
 *
 * Items in the group are of form:
 *
 * <device_name>=<device_type>
 *
 * Where device_name is sanitized evdev device name obtained via EVIOCGNAME
 * ioctl(), and device_type is one of : TOUCH, VOLKEY, DBLTAP, ...
 *
 * See evio_sanitize_key_name() and evin_evdevtype_parse() for details.
 */
#define MCE_CONF_EVDEV_TYPE_GROUP       "EVDEV_TYPE"

74 75 76
/* ========================================================================= *
 * Settings
 * ========================================================================= */
77

78
/** Prefix for event input setting keys */
79
# define MCE_SETTING_EVENT_INPUT_PATH       "/system/osso/dsm/event_input"
80

81
# ifdef ENABLE_DOUBLETAP_EMULATION
82 83 84 85 86
/** Whether double tap emulation is enabled
 *
 * When enabled, mce does double tap detection from "normal" touch events
 * that are received in display off an lpm states.
 */
87 88 89
#  define MCE_SETTING_USE_FAKE_DOUBLETAP    MCE_SETTING_EVENT_INPUT_PATH "/use_fake_double_tap"
#  define MCE_DEFAULT_USE_FAKE_DOUBLETAP    true
# endif
90

91 92 93 94 95 96
/** How long to delay touch unblock after display power up [ms]
 *
 * This can be used to fine tune input policy to make it less
 * likely that accidental touch events reach ui during in-call
 * proximity blanking etc.
 */
97 98
# define MCE_SETTING_TOUCH_UNBLOCK_DELAY    MCE_SETTING_EVENT_INPUT_PATH "/touch_unblock_delay"
# define MCE_DEFAULT_TOUCH_UNBLOCK_DELAY    100
99

100 101 102 103 104 105 106 107 108 109
/** What kind of evdev sources mce is allowed to grab [bitmask]
 *
 * By default mce grabs evdev sources dealing with touch events and volume
 * keys under certain circumstances.
 *
 * If this is not desirable for some reason (for example touchscreens
 * that use multitouch protocol B for reporting should not be grabbed),
 * the default value of this setting should be overridden in hw adaptation
 * specific configuration.
 */
110 111 112 113
# define MCE_SETTING_INPUT_GRAB_ALLOWED     MCE_SETTING_EVENT_INPUT_PATH "/input_grab_allowed"
# define MCE_INPUT_GRAB_ALLOW_NONE          (0)
# define MCE_INPUT_GRAB_ALLOW_TS            (1<<0)
# define MCE_INPUT_GRAB_ALLOW_KP            (1<<1)
114
# define MCE_DEFAULT_INPUT_GRAB_ALLOWED     0 // = MCE_INPUT_GRAB_ALLOW_NONE
115 116 117 118

/* ========================================================================= *
 * Functions
 * ========================================================================= */
119

120
gboolean mce_input_init(void);
121
void     mce_input_exit(void);
122

123
#endif /* EVENT_INPUT_H_ */