return ReportMismatch(keymap, action->type, field, "key name");
tmp = KeyNameToLong(key_name);
- key = FindNamedKey(keymap, tmp, true, CreateKeyNames(keymap), 0);
+ key = FindNamedKey(keymap, tmp, true, 0);
if (!key)
return ReportNotFound(keymap, action->type, field, "Key",
KeyNameText(key_name));
XkbFile *rtrn;
KeyNamesInfo included, next_incl;
- /* XXX: What's that? */
- if (stmt->file && streq(stmt->file, "computed")) {
- info->keymap->flags |= AutoKeyNames;
- info->explicitMin = 0;
- info->explicitMax = XKB_KEYCODE_MAX;
- return (info->errorCount == 0);
- }
-
InitKeyNamesInfo(&included, info->keymap, info->file_id);
if (stmt->stmt) {
free(included.name);
old = &darray_item(keymap->key_aliases, 0);
list_foreach(alias, &info->aliases, entry) {
- key = FindNamedKey(keymap, alias->real, false,
- CreateKeyNames(keymap), 0);
+ key = FindNamedKey(keymap, alias->real, false, 0);
if (!key) {
log_lvl(info->keymap->ctx, 5,
"Attempt to alias %s to non-existent key %s; Ignored\n",
continue;
}
- key = FindNamedKey(keymap, alias->alias, false, false, 0);
+ key = FindNamedKey(keymap, alias->alias, false, 0);
if (key) {
log_lvl(info->keymap->ctx, 5,
"Attempt to create alias with the name of a real key; "
* @param keymap The keymap to search in.
* @param name The 4-letter name of the key as a long.
* @param use_aliases true if the key aliases should be searched too.
- * @param create If true and the key is not found, it is added to the
- * keymap->names at the first free keycode.
* @param start_from Keycode to start searching from.
*
* @return the key if it is found, NULL otherwise.
*/
struct xkb_key *
FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
- bool use_aliases, bool create, xkb_keycode_t start_from)
+ bool use_aliases, xkb_keycode_t start_from)
{
struct xkb_key *key;
if (use_aliases) {
unsigned long new_name;
if (FindKeyNameForAlias(keymap, name, &new_name))
- return FindNamedKey(keymap, new_name, false, create, 0);
- }
-
- if (create) {
- /* Find first unused key and store our key here */
- xkb_foreach_key(key, keymap) {
- if (key->name[0] == '\0') {
- LongToKeyName(name, key->name);
- return key;
- }
- }
+ return FindNamedKey(keymap, new_name, false, 0);
}
return NULL;
useAlias = (start_from == 0);
- key = FindNamedKey(keymap, keyi->name, useAlias,
- CreateKeyNames(keymap), start_from);
+ key = FindNamedKey(keymap, keyi->name, useAlias, start_from);
if (!key) {
if (start_from == 0)
log_lvl(info->keymap->ctx, 5,
struct xkb_keymap *keymap = info->keymap;
if (!entry->haveSymbol) {
- key = FindNamedKey(keymap, entry->u.keyName, true,
- CreateKeyNames(keymap), 0);
+ key = FindNamedKey(keymap, entry->u.keyName, true, 0);
if (!key) {
log_lvl(info->keymap->ctx, 5,
"Key %s not found in keycodes; "
struct xkb_key *
FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
- bool use_aliases, bool create, xkb_keycode_t start_from);
+ bool use_aliases, xkb_keycode_t start_from);
extern bool
FindKeyNameForAlias(struct xkb_keymap *keymap, unsigned long lname,
CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,
enum merge_mode merge);
-#define AutoKeyNames (1L << 0)
-#define CreateKeyNames(x) ((x)->flags & AutoKeyNames)
-
#endif /* XKBCOMP_H */