geometry: Move keycode to costomizations

This commit is contained in:
Dorota Czaplejewicz
2019-08-02 14:35:03 +00:00
parent 04b721aed9
commit a18beca50c
2 changed files with 9 additions and 10 deletions

View File

@ -37,7 +37,7 @@
<key name="BKSP" /> <key name="BKSP" />
</section> </section>
<section angle="0"> <section angle="0">
<key keycode="0" name="ABC123" /> <key name="ABC123" />
<key name="I149" /> <key name="I149" />
<key name="SPCE" /> <key name="SPCE" />
<key name="AB08" /> <key name="AB08" />
@ -46,7 +46,7 @@
<button name="LFSH" oref="altline" /> <button name="LFSH" oref="altline" />
<button name="BKSP" oref="altline" /> <button name="BKSP" oref="altline" />
<button name="I149" oref="altline" /> <button name="I149" oref="altline" />
<button name="ABC123" oref="altline" /> <button name="ABC123" oref="altline" keycode="0" />
<button name="SPCE" oref="spaceline" /> <button name="SPCE" oref="spaceline" />
<button name="RTRN" oref="outline7" /> <button name="RTRN" oref="outline7" />
<outline id="default" corner-radius="1.000000"> <outline id="default" corner-radius="1.000000">

View File

@ -384,8 +384,6 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
} }
if (g_strcmp0 (element_name, "key") == 0) { if (g_strcmp0 (element_name, "key") == 0) {
guint keycode;
attribute = get_attribute (attribute_names, attribute_values, attribute = get_attribute (attribute_names, attribute_values,
"name"); "name");
if (attribute == NULL) { if (attribute == NULL) {
@ -397,12 +395,7 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
} }
gchar *name = g_strdup (attribute); gchar *name = g_strdup (attribute);
attribute = get_attribute (attribute_names, attribute_values, guint keycode = data->keycode++;
"keycode");
if (attribute != NULL)
keycode = strtol (attribute, NULL, 10);
else
keycode = data->keycode++;
data->key = eek_section_create_key (data->section, data->key = eek_section_create_key (data->section,
name, name,
@ -441,6 +434,12 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
key, key,
g_strdup (attribute)); g_strdup (attribute));
attribute = get_attribute (attribute_names, attribute_values,
"keycode");
if (attribute != NULL) {
eek_key_set_keycode(key, strtol (attribute, NULL, 10));
}
goto out; goto out;
} }