Update semantic shortcuts

Update BKeymap::GetModifiedCharacters() to translate a given character
and set of modifiers filling out a list of all characters that match for another
set of modifiers.

This allows us to, for example, get all characters in the normal map that
have the '+' character in the corresponding shift map.

It is fully generic allowing one to get a list of characters in any map given
a character and modifiers of another map.

Also I converted from using a BList to using a BObjectList.

With this, along with BWindow::HasShortcut(), the semantic shortcuts now
work not only with Command+'=', but any key in the normal map that has
'+' in it's shift map as long as it isn't already taken by another shortcut.
This commit is contained in:
John Scipione
2013-10-19 19:30:47 -04:00
parent 26a23118e7
commit bd336e3abc
4 changed files with 89 additions and 68 deletions
+4 -5
View File
@@ -12,10 +12,9 @@
#include <DataIO.h>
#include <InterfaceDefs.h>
#include <ObjectList.h>
class BList;
class BKeymap {
public:
BKeymap();
@@ -40,9 +39,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);
status_t GetModifiedCharacters(const char* in,
int32 inModifiers, int32 outModifiers,
BObjectList<const char>* _outList);
const key_map& Map() const { return fKeys; }