Program Listing for File keymap.h

Return to documentation for file (include\utility\keymap.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include <cstdint>

using UTF8Char = char;
using UTF8String = char const*;

namespace gpa {
namespace utility {

#undef MOD_SHIFT  //coming from windows.h
#undef MOD_ALT

enum Modifier {
    MOD_NONE = 0x00,
    MOD_LSHIFT = 0x01,
    MOD_RSHIFT = 0x02,
    MOD_SHIFT = MOD_LSHIFT | MOD_RSHIFT,
    MOD_LCTRL = 0x04,
    MOD_RCTRL = 0x08,
    MOD_CTRL = MOD_LCTRL | MOD_RCTRL,
    MOD_LALT = 0x10,
    MOD_RALT = 0x20,
    MOD_ALT = MOD_LALT | MOD_RALT,
};

class KeyMap
{
public:
    virtual ~KeyMap();

    virtual void Add(UTF8Char keyChar, UTF8String action, uint8_t modifier) = 0;

    virtual UTF8String Lookup(UTF8Char keyChar, uint8_t modifier) const = 0;

    virtual bool IsEmpty() const = 0;
};

KeyMap* CreateKeyMap();

}  // namespace utility
}  // namespace gpa