1 /* 2 * Copyright 2004-2008 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Jérôme Duval 7 */ 8 9 #ifndef KEYMAP_H 10 #define KEYMAP_H 11 12 #include <InterfaceDefs.h> 13 #include <Entry.h> 14 15 class Keymap 16 { 17 public: 18 status_t Load(entry_ref &ref); 19 status_t Save(entry_ref &ref); 20 void DumpKeymap(); 21 bool IsModifierKey(uint32 keyCode); 22 uint8 IsDeadKey(uint32 keyCode, uint32 modifiers); 23 bool IsDeadSecondKey(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey); 24 void GetChars(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey, char** chars, int32* numBytes); 25 status_t Use(); 26 bool Equals(const Keymap& map) const; 27 28 private: 29 char *fChars; 30 key_map fKeys; 31 uint32 fCharsSize; 32 char fName[B_FILE_NAME_LENGTH]; 33 }; 34 35 36 #endif //KEYMAP_H 37