Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: swapped location of the virtual key conversion table (host-event.c is not used in Base builds) #47

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion src/os/win32/dev-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,39 @@ WORD wOriginalAttributes = 0;
int Update_Graphic_Mode(int attribute, int value, boolean set);
const REBYTE* Parse_ANSI_sequence(const REBYTE *cp, const REBYTE *ep);

// Virtual key conversion table. Sorted by first column!
const WORD Key_To_Event[] = {
VK_SHIFT, EVK_SHIFT,
VK_CONTROL, EVK_CONTROL,
VK_MENU, EVK_ALT,
VK_PAUSE, EVK_PAUSE,
VK_CAPITAL, EVK_CAPITAL,
VK_ESCAPE, EVK_ESCAPE,
VK_PRIOR, EVK_PAGE_UP,
VK_NEXT, EVK_PAGE_DOWN,
VK_END, EVK_END,
VK_HOME, EVK_HOME,
VK_LEFT, EVK_LEFT,
VK_UP, EVK_UP,
VK_RIGHT, EVK_RIGHT,
VK_DOWN, EVK_DOWN,
VK_INSERT, EVK_INSERT,
VK_DELETE, EVK_DELETE,
VK_F1, EVK_F1,
VK_F2, EVK_F2,
VK_F3, EVK_F3,
VK_F4, EVK_F4,
VK_F5, EVK_F5,
VK_F6, EVK_F6,
VK_F7, EVK_F7,
VK_F8, EVK_F8,
VK_F9, EVK_F9,
VK_F10, EVK_F10,
VK_F11, EVK_F11,
VK_F12, EVK_F12,
0, 0
};

//**********************************************************************

BOOL WINAPI Handle_Break(DWORD dwCtrlType)
Expand Down Expand Up @@ -596,7 +629,6 @@ static void Close_StdIO_Local(void)
return DR_DONE;
}

extern const WORD Key_To_Event[]; // in host-event.c
/***********************************************************************
**
*/ DEVICE_CMD Poll_IO(REBREQ *req)
Expand Down
36 changes: 2 additions & 34 deletions src/os/win32/host-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,46 +70,14 @@ extern HWND Focused_Window;
#define IS_LAYERED(hwnd) ((WS_EX_LAYERED & GetWindowLongPtr(hwnd, GWL_EXSTYLE)) > 0)
#define GOB_FROM_HWND(hwnd) (REBGOB *)GetWindowLongPtr(hwnd, GWLP_USERDATA)

//***** Constants *****

// Virtual key conversion table. Sorted by first column!
const WORD Key_To_Event[] = {
VK_SHIFT, EVK_SHIFT,
VK_CONTROL, EVK_CONTROL,
VK_MENU, EVK_ALT,
VK_PAUSE, EVK_PAUSE,
VK_CAPITAL, EVK_CAPITAL,
VK_ESCAPE, EVK_ESCAPE,
VK_PRIOR, EVK_PAGE_UP,
VK_NEXT, EVK_PAGE_DOWN,
VK_END, EVK_END,
VK_HOME, EVK_HOME,
VK_LEFT, EVK_LEFT,
VK_UP, EVK_UP,
VK_RIGHT, EVK_RIGHT,
VK_DOWN, EVK_DOWN,
VK_INSERT, EVK_INSERT,
VK_DELETE, EVK_DELETE,
VK_F1, EVK_F1,
VK_F2, EVK_F2,
VK_F3, EVK_F3,
VK_F4, EVK_F4,
VK_F5, EVK_F5,
VK_F6, EVK_F6,
VK_F7, EVK_F7,
VK_F8, EVK_F8,
VK_F9, EVK_F9,
VK_F10, EVK_F10,
VK_F11, EVK_F11,
VK_F12, EVK_F12,
0, 0
};


//***** Externs *****

extern HCURSOR Cursor;
extern void Done_Device(int handle, int error);
extern void Paint_Window(HWND window);
extern const WORD Key_To_Event[]; // in dev-stdio.c



Expand Down
Loading