1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2011 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Jason Smith <jason.smith@canonical.com>
20
#ifndef KEYBOARDUTIL_H
21
#define KEYBOARDUTIL_H
25
#include <X11/keysym.h>
26
#include <X11/XKBlib.h>
27
#include <X11/extensions/XKBgeom.h>
39
KeyboardUtil(Display *display);
40
virtual ~KeyboardUtil();
42
guint GetKeycodeAboveKeySymbol(KeySym key_symbol);
45
bool CompareOffsets (int current_x, int current_y, int best_x, int best_y);
46
guint ConvertKeyToKeycode (XkbKeyPtr key);
48
bool FindKeyInGeometry(XkbGeometryPtr geo, char *key_name, int& res_section, XkbBoundsRec& res_bounds);
49
bool FindKeyInSectionAboveBounds (XkbGeometryPtr geo, int section, XkbBoundsRec const& target_bounds, guint &keycode);
51
XkbBoundsRec GetAbsoluteKeyBounds (XkbKeyPtr key, XkbRowPtr row, XkbSectionPtr section, XkbGeometryPtr geo);
60
#endif // KEYBOARDUTIL_H