diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c index edf48235dff..e49d8a5e6c1 100644 --- a/tools/wrc/genres.c +++ b/tools/wrc/genres.c @@ -282,6 +282,7 @@ static int parse_accel_string( const string_t *key, int flags ) if(key->type == str_char) { + if (key->str.cstr[0] == '#') return 0; /* ignore message contexts */ if((flags & WRC_AF_VIRTKEY) && !((key->str.cstr[0] >= 'A' && key->str.cstr[0] <= 'Z') || (key->str.cstr[0] >= '0' && key->str.cstr[0] <= '9'))) @@ -309,6 +310,7 @@ static int parse_accel_string( const string_t *key, int flags ) } else { + if (key->str.wstr[0] == '#') return 0; /* ignore message contexts */ if((flags & WRC_AF_VIRTKEY) && !((key->str.wstr[0] >= 'A' && key->str.wstr[0] <= 'Z') || (key->str.wstr[0] >= '0' && key->str.wstr[0] <= '9'))) diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y index efcc050470c..4cc37ac406f 100644 --- a/tools/wrc/parser.y +++ b/tools/wrc/parser.y @@ -2175,52 +2175,9 @@ static event_t *add_event(int key, int id, int flags, event_t *prev) static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev) { - int keycode = 0; event_t *ev = new_event(); - if(key->type == str_char) - { - if((flags & WRC_AF_VIRTKEY) && - !((key->str.cstr[0] >= 'A' && key->str.cstr[0] <= 'Z') || - (key->str.cstr[0] >= '0' && key->str.cstr[0] <= '9'))) - yyerror("VIRTKEY code is not equal to ascii value"); - - if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) - { - yyerror("Cannot use both '^' and CONTROL modifier"); - } - else if(key->str.cstr[0] == '^') - { - keycode = toupper((unsigned char)key->str.cstr[1]) - '@'; - if(keycode >= ' ') - yyerror("Control-code out of range"); - } - else - keycode = key->str.cstr[0]; - } - else - { - if((flags & WRC_AF_VIRTKEY) && - !((key->str.wstr[0] >= 'A' && key->str.wstr[0] <= 'Z') || - (key->str.wstr[0] >= '0' && key->str.wstr[0] <= '9'))) - yyerror("VIRTKEY code is not equal to ascii value"); - - if(key->str.wstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) - { - yyerror("Cannot use both '^' and CONTROL modifier"); - } - else if(key->str.wstr[0] == '^') - { - keycode = toupperW(key->str.wstr[1]) - '@'; - if(keycode >= ' ') - yyerror("Control-code out of range"); - } - else - keycode = key->str.wstr[0]; - } - ev->str = key; - ev->key = keycode; ev->id = id; ev->flags = flags & ~WRC_AF_ASCII; ev->prev = prev;