FifeGUI 0.3.0
A C++ GUI library designed for games.
key.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5// Corresponding header include
6#include "fifechan/key.hpp"
7
8namespace fcn
9{
10 Key::Key(int value) : mValue(value)
11 {
12 }
13
14 bool Key::isCharacter() const
15 {
16 return (mValue >= 32 && mValue <= 126) || (mValue >= 162 && mValue <= 255) || (mValue == 9);
17 }
18
19 bool Key::isNumber() const
20 {
21 return mValue >= 48 && mValue <= 57;
22 }
23
24 bool Key::isLetter() const
25 {
26 return (
27 ((mValue >= 65 && mValue <= 90) || (mValue >= 97 && mValue <= 122) || (mValue >= 192 && mValue <= 255)) &&
28 (mValue != 215) && (mValue != 247));
29 }
30
31 int Key::getValue() const
32 {
33 return mValue;
34 }
35
36 bool Key::operator==(Key const & other) const
37 {
38 return mValue == other.mValue;
39 }
40
41 bool Key::operator!=(Key const & other) const
42 {
43 return (mValue != other.mValue);
44 }
45} // namespace fcn
Used replacement tokens by configure_file():