Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
b02ffc75
Commit
b02ffc75
authored
Oct 11, 1998
by
Marcus Meissner
Committed by
Alexandre Julliard
Oct 11, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added bad hacks so WriteConsoleOutput works on vt100 and PeekMessage
does at least a bit of keyboard input.
parent
41786297
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
7 deletions
+79
-7
console.c
win32/console.c
+79
-7
No files found.
win32/console.c
View file @
b02ffc75
...
@@ -9,8 +9,10 @@
...
@@ -9,8 +9,10 @@
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <termios.h>
#include <termios.h>
#include <strings.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <unistd.h>
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
...
@@ -597,8 +599,39 @@ BOOL32 WINAPI WriteConsoleOutput32A( HANDLE32 hConsoleOutput,
...
@@ -597,8 +599,39 @@ BOOL32 WINAPI WriteConsoleOutput32A( HANDLE32 hConsoleOutput,
COORD
dwBufferCoord
,
COORD
dwBufferCoord
,
LPSMALL_RECT
lpWriteRegion
)
LPSMALL_RECT
lpWriteRegion
)
{
{
FIXME
(
console
,
"(...):stub
\n
"
);
int
i
,
j
,
off
=
0
,
lastattr
=-
1
;
return
FALSE
;
char
buffer
[
200
];
DWORD
res
;
static
int
colormap
[
8
]
=
{
0
,
4
,
2
,
6
,
1
,
5
,
3
,
7
,
};
TRACE
(
console
,
"wr: top = %d, bottom=%d, left=%d,right=%d
\n
"
,
lpWriteRegion
->
Top
,
lpWriteRegion
->
Bottom
,
lpWriteRegion
->
Left
,
lpWriteRegion
->
Right
);
for
(
i
=
lpWriteRegion
->
Top
;
i
<=
lpWriteRegion
->
Bottom
;
i
++
)
{
sprintf
(
buffer
,
"%c[%d;%dH"
,
27
,
i
,
lpWriteRegion
->
Left
);
WriteFile
(
hConsoleOutput
,
buffer
,
strlen
(
buffer
),
&
res
,
NULL
);
if
(
lastattr
!=
lpBuffer
[
off
].
Attributes
)
{
lastattr
=
lpBuffer
[
off
].
Attributes
;
sprintf
(
buffer
,
"%c[0;3%d;4%d"
,
27
,
colormap
[
lastattr
&
7
],
colormap
[(
lastattr
&
0x70
)
>>
4
]);
if
(
lastattr
&
FOREGROUND_INTENSITY
)
strcat
(
buffer
,
";1"
);
/* BACKGROUND_INTENSITY */
strcat
(
buffer
,
"m"
);
WriteFile
(
hConsoleOutput
,
buffer
,
strlen
(
buffer
),
&
res
,
NULL
);
}
for
(
j
=
lpWriteRegion
->
Left
;
j
<=
lpWriteRegion
->
Right
;
j
++
)
WriteFile
(
hConsoleOutput
,
&
(
lpBuffer
[
off
++
].
Char
.
AsciiChar
),
1
,
&
res
,
NULL
);
}
sprintf
(
buffer
,
"%c[0m"
,
27
);
WriteFile
(
hConsoleOutput
,
buffer
,
strlen
(
buffer
),
&
res
,
NULL
);
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -832,11 +865,50 @@ BOOL32 WINAPI PeekConsoleInput32A(HANDLE32 hConsoleInput,
...
@@ -832,11 +865,50 @@ BOOL32 WINAPI PeekConsoleInput32A(HANDLE32 hConsoleInput,
DWORD
cInRecords
,
DWORD
cInRecords
,
LPDWORD
lpcRead
)
LPDWORD
lpcRead
)
{
{
pirBuffer
=
NULL
;
fd_set
infds
;
cInRecords
=
0
;
int
i
,
fd
=
FILE_GetUnixHandle
(
hConsoleInput
);
*
lpcRead
=
0
;
struct
timeval
tv
;
FIXME
(
console
,
"(%d,%p,%ld,%p): stub
\n
"
,
hConsoleInput
,
pirBuffer
,
char
inchar
;
cInRecords
,
lpcRead
);
DWORD
res
;
static
int
keystate
[
256
];
LPINPUT_RECORD
ir
=
pirBuffer
;
TRACE
(
console
,
"(%d,%p,%ld,%p): stub
\n
"
,
hConsoleInput
,
pirBuffer
,
cInRecords
,
lpcRead
);
memset
(
&
tv
,
0
,
sizeof
(
tv
));
FD_ZERO
(
&
infds
);
FD_SET
(
fd
,
&
infds
);
select
(
fd
+
1
,
&
infds
,
NULL
,
NULL
,
&
tv
);
if
(
FD_ISSET
(
fd
,
&
infds
))
{
ReadFile
(
hConsoleInput
,
&
inchar
,
1
,
&
res
,
NULL
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
if
(
keystate
[
i
]
&&
i
!=
inchar
)
{
ir
->
EventType
=
1
;
ir
->
Event
.
KeyEvent
.
bKeyDown
=
0
;
ir
->
Event
.
KeyEvent
.
wRepeatCount
=
0
;
ir
->
Event
.
KeyEvent
.
wVirtualKeyCode
=
0
;
ir
->
Event
.
KeyEvent
.
wVirtualScanCode
=
0
;
ir
->
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
i
;
ir
->
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
ir
++
;
keystate
[
i
]
=
0
;
}
}
ir
->
EventType
=
1
;
/* Key_event */
ir
->
Event
.
KeyEvent
.
bKeyDown
=
1
;
ir
->
Event
.
KeyEvent
.
wRepeatCount
=
0
;
ir
->
Event
.
KeyEvent
.
wVirtualKeyCode
=
0
;
ir
->
Event
.
KeyEvent
.
wVirtualScanCode
=
0
;
ir
->
Event
.
KeyEvent
.
uChar
.
AsciiChar
=
inchar
;
ir
->
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
keystate
[
inchar
]
=
1
;
ir
++
;
*
lpcRead
=
ir
-
pirBuffer
;
}
else
{
*
lpcRead
=
0
;
}
return
TRUE
;
return
TRUE
;
}
}
...
...
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