Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
811da88c
Commit
811da88c
authored
Jan 30, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Fix parsing of virtkey accelerators.
parent
c4fb5b89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
43 deletions
+2
-43
genres.c
tools/wrc/genres.c
+2
-0
parser.y
tools/wrc/parser.y
+0
-43
No files found.
tools/wrc/genres.c
View file @
811da88c
...
@@ -282,6 +282,7 @@ static int parse_accel_string( const string_t *key, int flags )
...
@@ -282,6 +282,7 @@ static int parse_accel_string( const string_t *key, int flags )
if
(
key
->
type
==
str_char
)
if
(
key
->
type
==
str_char
)
{
{
if
(
key
->
str
.
cstr
[
0
]
==
'#'
)
return
0
;
/* ignore message contexts */
if
((
flags
&
WRC_AF_VIRTKEY
)
&&
if
((
flags
&
WRC_AF_VIRTKEY
)
&&
!
((
key
->
str
.
cstr
[
0
]
>=
'A'
&&
key
->
str
.
cstr
[
0
]
<=
'Z'
)
||
!
((
key
->
str
.
cstr
[
0
]
>=
'A'
&&
key
->
str
.
cstr
[
0
]
<=
'Z'
)
||
(
key
->
str
.
cstr
[
0
]
>=
'0'
&&
key
->
str
.
cstr
[
0
]
<=
'9'
)))
(
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 )
...
@@ -309,6 +310,7 @@ static int parse_accel_string( const string_t *key, int flags )
}
}
else
else
{
{
if
(
key
->
str
.
wstr
[
0
]
==
'#'
)
return
0
;
/* ignore message contexts */
if
((
flags
&
WRC_AF_VIRTKEY
)
&&
if
((
flags
&
WRC_AF_VIRTKEY
)
&&
!
((
key
->
str
.
wstr
[
0
]
>=
'A'
&&
key
->
str
.
wstr
[
0
]
<=
'Z'
)
||
!
((
key
->
str
.
wstr
[
0
]
>=
'A'
&&
key
->
str
.
wstr
[
0
]
<=
'Z'
)
||
(
key
->
str
.
wstr
[
0
]
>=
'0'
&&
key
->
str
.
wstr
[
0
]
<=
'9'
)))
(
key
->
str
.
wstr
[
0
]
>=
'0'
&&
key
->
str
.
wstr
[
0
]
<=
'9'
)))
...
...
tools/wrc/parser.y
View file @
811da88c
...
@@ -2175,52 +2175,9 @@ static event_t *add_event(int key, int id, int flags, event_t *prev)
...
@@ -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
)
static
event_t
*
add_string_event
(
string_t
*
key
,
int
id
,
int
flags
,
event_t
*
prev
)
{
{
int
keycode
=
0;
event_t
*ev
=
new_event();
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->str
=
key;
ev-
>
key
=
keycode
;
ev->id
=
id;
ev->id
=
id;
ev->flags
=
flags
&
~WRC_AF_ASCII;
ev->flags
=
flags
&
~WRC_AF_ASCII;
ev->prev
=
prev;
ev->prev
=
prev;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment