Subj : Linux / 5D
To   : Wilfred van Velzen
From : Oli
Date : Thu Feb 23 2023 11:33 am

Wilfred wrote (2023-02-23):

WvV> It seems to have to do with how the getch() function is implemented in
WvV> the MingW compiler. The version in the old Borland Compiler seems to work
WvV> in reactos, or so some tests I did seems to indicate.

WvV> A few years back I made a little test program that showed this when
WvV> compiled with different compilers:
WvV> http://fmail.vlzn.nl/files/getchtest.zip

I've compiled it with conio.h from https://github.com/casualsnek/linuxconio on Linux and this is what I get when pressing

UP
DOWN
F1
F2
INS
DEL

$ ./getchtest-linuxconio
  27 - 0000001B - '
  91 - 0000005B - '['
  65 - 00000041 - 'A'
  27 - 0000001B - '
  91 - 0000005B - '['
  66 - 00000042 - 'B'
  27 - 0000001B - '
  79 - 0000004F - 'O'
  80 - 00000050 - 'P'
  27 - 0000001B - '
  79 - 0000004F - 'O'
  81 - 00000051 - 'Q'
  27 - 0000001B - '
  91 - 0000005B - '['
  50 - 00000032 - '2'
 126 - 0000007E - '~'
  27 - 0000001B - '
  91 - 0000005B - '['
  51 - 00000033 - '3'
 126 - 0000007E - '~'

and with wine:

$ wine getchtest-borland.exe
   0 - 00000000 - ''
  72 - 00000048 - 'H'
   0 - 00000000 - ''
  80 - 00000050 - 'P'
   0 - 00000000 - ''
  59 - 0000003B - ';'
   0 - 00000000 - ''
  60 - 0000003C - '<'
   0 - 00000000 - ''
  82 - 00000052 - 'R'
   0 - 00000000 - ''
  83 - 00000053 - 'S'

$ wine getchtest-mingw32.exe
 224 - 000000E0 - 'à'
  72 - 00000048 - 'H'
 224 - 000000E0 - 'à'
  80 - 00000050 - 'P'
[F1 nothing]
[F2 nothing]
 224 - 000000E0 - 'à'
  82 - 00000052 - 'R'
 224 - 000000E0 - 'à'
  83 - 00000053 - 'S'

I don't have 64-bit wine.

---
* Origin: War is Peace. Freedom is Slavery. Ignorance is Strength. (2:280/464.47)