Fixed some IF conditions regarding --export-keymap switch.

git-svn-id: https://logkeys.googlecode.com/svn/trunk@71 c501e62c-e7d1-11de-a198-37193048d1ed
This commit is contained in:
kernc 2010-08-19 14:51:03 +00:00
parent c0435b7e97
commit f7b08468e6
2 changed files with 13 additions and 13 deletions

View File

@ -56,7 +56,7 @@ inline bool is_used_key(unsigned int code)
return (char_or_func[code] != '_');
}
// translates character keycodes to continuous array indices
// translates character keycodes to continuous array indexes
inline int to_char_keys_index(unsigned int keycode)
{
if (keycode >= KEY_1 && keycode <= KEY_EQUAL) // keycodes 2-13: US keyboard: 1, 2, ..., 0, -, =
@ -73,7 +73,7 @@ inline int to_char_keys_index(unsigned int keycode)
return -1; // not character keycode
}
// translates function keys keycodes to continuous array indices
// translates function keys keycodes to continuous array indexes
inline int to_func_keys_index(unsigned int keycode)
{
if (keycode == KEY_ESC) // 1

View File

@ -377,23 +377,23 @@ int main(int argc, char **argv)
}
// check for incompatible flags
if (args.keymap && args.us_keymap) {
if (args.keymap && (!(args.flags & FLAG_EXPORT_KEYMAP) && args.us_keymap)) { // exporting uses args.keymap also
error(EXIT_FAILURE, 0, "Incompatible flags '-m' and '-u'. See usage.");
}
set_utf8_locale();
if (args.start && args.keymap && !(args.flags & FLAG_EXPORT_KEYMAP)) {
// read keymap from file
parse_input_keymap();
}
else if ((args.start && !args.us_keymap) || (args.flags & FLAG_EXPORT_KEYMAP)) {
// get keymap used by the system and optionally export it to file
determine_system_keymap();
// export keymap if so requested
if ((args.flags & FLAG_EXPORT_KEYMAP)) export_keymap_to_file();
if (args.flags & FLAG_EXPORT_KEYMAP) {
if (!args.us_keymap)
determine_system_keymap();
export_keymap_to_file();
// = exit(0)
}
else if (args.keymap) // custom keymap in use
parse_input_keymap();
else
determine_system_keymap();
if (args.device == NULL) { // no device given with -d switch
determine_input_device();