-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux and macOS preparation stuff, other platforms not affected.
- Loading branch information
Showing
6 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
Binary file added
BIN
+1.7 KB
SonicTimeTwisted.gmx/Configs/Linux/Windows8/Win8NativeRunner_TemporaryKey.pfx
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# libnikXfix | ||
|
||
This is a small library that fixes YoYo Games's bug where any non-latin keyboard layout wouldn't work. | ||
|
||
Compilation steps and all are explained in the `nikxfix.c` file. | ||
|
||
All you need is Ubuntu 14.04 and gcc-multilib. | ||
|
||
The only dependency is GNU's libC. | ||
|
||
To-be-loaded via `LD_LIBRARY_PATH` and then `LD_PRELOAD`. | ||
|
||
Have fun. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
libnikXfix by nkrapivindev, Sonic Time Twisted edition. | ||
Install gcc-multilib | ||
Compile me as: | ||
gcc -m32 -fPIC -ldl -shared nikxfix.c -o libnikxfix.so | ||
Then update the lib in included files [root]/SonicTimeTwisted.gmx/datafiles/ | ||
Enjoy! | ||
*/ | ||
#ifndef _GNU_SOURCE | ||
#define _GNU_SOURCE 1 | ||
#endif | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <X11/Xlib.h> | ||
#include <X11/Xutil.h> | ||
#include <dlfcn.h> | ||
|
||
typedef int (*XLookupString_type)(XKeyEvent*, char*, int, KeySym*, XComposeStatus*); | ||
static XLookupString_type XLookupString_orig = NULL; | ||
|
||
#define NPRINT(...) do { printf("[nikXfix]: "); printf(__VA_ARGS__); printf("\n"); fflush(stdout); } while (0) | ||
|
||
int XLookupString( | ||
XKeyEvent* event_struct, | ||
char* buffer_return, | ||
int bytes_buffer, | ||
KeySym* keysym_return, | ||
XComposeStatus* status_in_out | ||
) { | ||
int rc; /* return code */ | ||
|
||
if (!XLookupString_orig) { | ||
NPRINT("Trying to resolve XLookupString..."); | ||
XLookupString_orig = dlsym(RTLD_NEXT, "XLookupString"); | ||
if (!XLookupString_orig) { | ||
NPRINT("Unable to resolve XLookupString!"); | ||
abort(); | ||
} | ||
NPRINT("XLookupString is resolved to 0x%p", XLookupString_orig); | ||
} | ||
|
||
/* restricts the bitmask to 8bit range only, excluding all locale info, change if this breaks things! */ | ||
if (event_struct) event_struct->state &= 0xFFu; | ||
rc = XLookupString_orig(event_struct, buffer_return, bytes_buffer, keysym_return, status_in_out); | ||
|
||
/* big fun */ | ||
#ifdef DEBUG | ||
NPRINT("rc=%d,keycode=0x%X,state=0x%X", rc, event_struct->keycode, event_struct->state); | ||
#endif | ||
|
||
return rc; | ||
} | ||
|
||
|