Keymap: Add a method to get modified characters for a key
This method fills out the passed-in BList of modified utf-8 characters for a given utf-8 character and set of modifiers. For example if you pass in "=" and B_SHIFT_KEY the list will get filled out with each character in the shift map that has "=" in the normal map. Each supported keymap modifier combination is available. The reason this is useful will soon become apparent. A BList is used because the character might be mapped multiple times, for example if you have a Mac keyboard you've got two "=" keys, one in 0x1d and one in 0x6a. The caller is responsible for creating the BList and destroying it as well as freeing the resulting character strings.
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <InterfaceDefs.h>
|
||||
|
||||
|
||||
class BList;
|
||||
|
||||
class BKeymap {
|
||||
public:
|
||||
BKeymap();
|
||||
@@ -38,6 +40,9 @@ public:
|
||||
void GetChars(uint32 keyCode, uint32 modifiers,
|
||||
uint8 activeDeadKey, char** chars,
|
||||
int32* numBytes) const;
|
||||
status_t GetModifiedCharacters(const char* normal,
|
||||
int32 modifiers,
|
||||
BList* _modifiedCharacters);
|
||||
|
||||
const key_map& Map() const { return fKeys; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user