Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a9c19f07
Commit
a9c19f07
authored
Jul 29, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
Jul 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let Int09 routines remember a keystroke's ASCII code, if available.
parent
eba5752f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
15 deletions
+27
-15
miscemu.h
include/miscemu.h
+2
-2
dosvm.c
loader/dos/dosvm.c
+2
-2
int09.c
msdos/int09.c
+22
-10
ioports.c
msdos/ioports.c
+1
-1
No files found.
include/miscemu.h
View file @
a9c19f07
...
...
@@ -174,8 +174,8 @@ extern void IO_outport( int port, int count, DWORD value );
/* msdos/int09.c */
extern
void
WINAPI
INT_Int09Handler
(
CONTEXT86
*
);
extern
void
WINAPI
INT_Int09SendScan
(
BYTE
);
extern
BYTE
WINAPI
INT_Int09ReadScan
(
void
);
extern
void
WINAPI
INT_Int09SendScan
(
BYTE
scan
,
BYTE
ascii
);
extern
BYTE
WINAPI
INT_Int09ReadScan
(
BYTE
*
ascii
);
/* msdos/int10.c */
extern
void
WINAPI
INT_Int10Handler
(
CONTEXT86
*
);
...
...
loader/dos/dosvm.c
View file @
a9c19f07
...
...
@@ -341,9 +341,9 @@ void DOSVM_ProcessMessage(LPDOSTASK lpDosTask,MSG *msg)
/* FIXME: some keys (function keys) have
* extended bit set even when they shouldn't,
* should check for them */
INT_Int09SendScan
(
0xE0
);
INT_Int09SendScan
(
0xE0
,
0
);
}
INT_Int09SendScan
(
scan
);
INT_Int09SendScan
(
scan
,
0
);
break
;
}
}
...
...
msdos/int09.c
View file @
a9c19f07
...
...
@@ -15,7 +15,7 @@
DEFAULT_DEBUG_CHANNEL
(
int
)
typedef
struct
{
BYTE
queuelen
,
queue
[
15
];
BYTE
queuelen
,
queue
[
15
]
,
ascii
[
15
]
;
}
KBDSYSTEM
;
/**********************************************************************
...
...
@@ -25,15 +25,21 @@ typedef struct {
*/
void
WINAPI
INT_Int09Handler
(
CONTEXT86
*
context
)
{
BYTE
scan
=
INT_Int09ReadScan
(
);
BYTE
ascii
,
scan
=
INT_Int09ReadScan
(
&
ascii
);
UINT
vkey
=
MapVirtualKeyA
(
scan
&
0x7f
,
1
);
BYTE
ch
[
2
];
int
cnt
,
c2
;
TRACE
(
"scan=%02x
\n
"
,
scan
);
if
(
!
(
scan
&
0x80
))
{
/* as in TranslateMessage, windows/input.c */
cnt
=
ToAscii
(
vkey
,
scan
,
QueueKeyStateTable
,
(
LPWORD
)
ch
,
0
);
if
(
ascii
)
{
/* we already have an ASCII code, no translation necessary */
ch
[
0
]
=
ascii
;
cnt
=
1
;
}
else
{
/* as in TranslateMessage, windows/input.c */
cnt
=
ToAscii
(
vkey
,
scan
,
QueueKeyStateTable
,
(
LPWORD
)
ch
,
0
);
}
if
(
cnt
>
0
)
{
for
(
c2
=
0
;
c2
<
cnt
;
c2
++
)
INT_Int16AddChar
(
ch
[
c2
],
scan
);
...
...
@@ -56,12 +62,14 @@ static void KbdRelay( LPDOSTASK lpDosTask, CONTEXT86 *context, void *data )
* we'll remove current scancode from keyboard buffer here,
* rather than in ReadScan, because some DOS apps depend on
* the scancode being available for reading multiple times... */
if
(
--
sys
->
queuelen
)
if
(
--
sys
->
queuelen
)
{
memmove
(
sys
->
queue
,
sys
->
queue
+
1
,
sys
->
queuelen
);
memmove
(
sys
->
ascii
,
sys
->
ascii
+
1
,
sys
->
queuelen
);
}
}
}
void
WINAPI
INT_Int09SendScan
(
BYTE
scan
)
void
WINAPI
INT_Int09SendScan
(
BYTE
scan
,
BYTE
ascii
)
{
KBDSYSTEM
*
sys
=
(
KBDSYSTEM
*
)
DOSVM_GetSystemData
(
0x09
);
if
(
!
sys
)
{
...
...
@@ -69,16 +77,20 @@ void WINAPI INT_Int09SendScan( BYTE scan )
DOSVM_SetSystemData
(
0x09
,
sys
);
}
/* add scancode to queue */
sys
->
queue
[
sys
->
queuelen
++
]
=
scan
;
sys
->
queue
[
sys
->
queuelen
]
=
scan
;
sys
->
ascii
[
sys
->
queuelen
++
]
=
ascii
;
/* tell app to read it by triggering IRQ 1 (int 09) */
DOSVM_QueueEvent
(
1
,
DOS_PRIORITY_KEYBOARD
,
KbdRelay
,
NULL
);
}
BYTE
WINAPI
INT_Int09ReadScan
(
void
)
BYTE
WINAPI
INT_Int09ReadScan
(
BYTE
*
ascii
)
{
KBDSYSTEM
*
sys
=
(
KBDSYSTEM
*
)
DOSVM_GetSystemData
(
0x09
);
if
(
sys
)
if
(
sys
)
{
if
(
ascii
)
*
ascii
=
sys
->
ascii
[
0
];
return
sys
->
queue
[
0
];
else
}
else
{
if
(
ascii
)
*
ascii
=
0
;
return
0
;
}
}
msdos/ioports.c
View file @
a9c19f07
...
...
@@ -324,7 +324,7 @@ DWORD IO_inport( int port, int size )
break
;
}
case
0x60
:
res
=
INT_Int09ReadScan
();
res
=
INT_Int09ReadScan
(
NULL
);
#if 0 /* what's this port got to do with parport ? */
res = (DWORD)parport_8255[0];
#endif
...
...
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