Spiegel
Wheel Shatterer
How compile on Linux & change key event system
Tested on Ubuntu - Updated 12/06/2020
With this thread you'll be able to use azerty layout with the game (or dvorak or anything else)
Build Sonic Robo Blast 2
Compilation
Installing dependencies :
Download Source code :
Locate the folder :
Start Compiling :
One line copy past to build :
Your compiled executable is in
~/SRB2/bin/Linux64/Release/
Build Sonic Robo Blast 2 Kart
Installing dependencies :
Download Source code :
Locate the folder :
Start Compiling :
One line copy past to build :
Your compiled executable is in
~/Kart-Public/bin/Linux64/Release/
How change the key event system
Before start the compilation, open "src/sdl/i_video.c" in your favorite text editor
There is few replacements to do
Replace
(SDL_Scancode code)
by
(SDL_Keycode code)
code >= SDL_SCANCODE_
by
code >= SDLK_
code <= SDL_SCANCODE_
by
code <= SDLK_
code - SDL_SCANCODE_
by
code - SDLK_
code == SDL_
by
code == SDLK_
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.scancode);
by
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.sym);
case SDL_SCANCODE_
by
case SDLK_
Then add
#ifdef HWRENDER
DBG_Printf("Unknown incoming scancode: %d, represented %c\n",
code,
SDL_GetKeyName(SDL_GetKeyFromScancode(code)));
#endif
return 0;
}
before
static void SDLdoGrabMouse(void)
Original post
Ps : if you just want to compile srb2 on your linux debian system (or derivated as ubuntu, not sure for others gnu etc) jump to this post. :)
Tested on Ubuntu - Updated 12/06/2020
With this thread you'll be able to use azerty layout with the game (or dvorak or anything else)
Build Sonic Robo Blast 2
Compilation
Installing dependencies :
Code:
sudo apt install -y libgme-dev libsdl2-mixer-dev libsdl2-dev zlib1g-dev libpng-dev nasm build-essential git libcurl4 libcurl4-openssl-dev
Code:
https://github.com/STJr/SRB2.git
Code:
cd SRB2
Code:
export LIBGME_CFLAGS=
export LIBGME_LDFLAGS=-lgme
make -C src/ LINUX64=1
One line copy past to build :
Code:
sudo apt install -y libgme-dev libsdl2-mixer-dev libsdl2-dev zlib1g-dev libpng-dev nasm build-essential git libcurl4 libcurl4-openssl-dev ; git clone https://github.com/B4rabbas/SRB2.git ; cd SRB2 ; export LIBGME_CFLAGS= ; export LIBGME_LDFLAGS=-lgme ; make -C src/ LINUX64=1
Your compiled executable is in
~/SRB2/bin/Linux64/Release/
Build Sonic Robo Blast 2 Kart
Installing dependencies :
Code:
sudo apt install -y libgme-dev libsdl2-mixer-dev libsdl2-dev zlib1g-dev libpng-dev nasm build-essential git libcurl4 libcurl4-openssl-dev
Code:
git clone https://github.com/STJr/Kart-Public.git
Code:
cd Kart-Public
Code:
export LIBGME_CFLAGS=
export LIBGME_LDFLAGS=-lgme
make -C src/ LINUX64=1
One line copy past to build :
Code:
sudo apt install -y libgme-dev libsdl2-mixer-dev libsdl2-dev zlib1g-dev libpng-dev nasm build-essential git libcurl4 libcurl4-openssl-dev ; git clone https://github.com/STJr/Kart-Public.git ; cd Kart-Public ; export LIBGME_CFLAGS= ; export LIBGME_LDFLAGS=-lgme ; make -C src/ LINUX64=1
Your compiled executable is in
~/Kart-Public/bin/Linux64/Release/
How change the key event system
Before start the compilation, open "src/sdl/i_video.c" in your favorite text editor
There is few replacements to do
Replace
(SDL_Scancode code)
by
(SDL_Keycode code)
code >= SDL_SCANCODE_
by
code >= SDLK_
code <= SDL_SCANCODE_
by
code <= SDLK_
code - SDL_SCANCODE_
by
code - SDLK_
code == SDL_
by
code == SDLK_
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.scancode);
by
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.sym);
case SDL_SCANCODE_
by
case SDLK_
Then add
#ifdef HWRENDER
DBG_Printf("Unknown incoming scancode: %d, represented %c\n",
code,
SDL_GetKeyName(SDL_GetKeyFromScancode(code)));
#endif
return 0;
}
before
static void SDLdoGrabMouse(void)
Original post
Edit : Solved, thanks to thevintagemood who explain what modifications to do. Here is the src/sdl/i_video.c edited to be used for every keyboard layour.
https://github.com/B4rabbas/Sonic-Kart/blob/master/src/sdl/i_video.c
Due to the need the subject isn't anymore an help for some command scripting but for code modifications. The goal is to use azerty keyboard (or dvorak or any type of keyboard layout) with the game.
The real problem the non qwerty users are experiencing is the the key event use the scan code, and don't care about the layout is associated with it at your home, you can change your layout at home this will not work, it don't care 'cause this dont change the scancode.
Thanks to discord community who've helped me, especially AlamTaz for his patience.
So if I have understood correctly in SRB2/blob/master/libs/SDL2/include/SDL_keyboard.h
https://github.com/STJr/SRB2/blob/master/libs/SDL2/include/SDL_keyboard.h
I have (maybe not tried yet) to replace all mention to "SDL_Scancode" by "SDL_Keycode" in the file.
I'll give more info of this sacred quest :°)
Hello Folks,
I'm looking wich command I should use to rebind a key linto an other key.
By exemple I would like to bind A to type Q in chatrrom
I've try
or
or
or
But there is no change, here is some missing argument in my command ?
Many Thanks. :)
https://github.com/B4rabbas/Sonic-Kart/blob/master/src/sdl/i_video.c
Due to the need the subject isn't anymore an help for some command scripting but for code modifications. The goal is to use azerty keyboard (or dvorak or any type of keyboard layout) with the game.
The real problem the non qwerty users are experiencing is the the key event use the scan code, and don't care about the layout is associated with it at your home, you can change your layout at home this will not work, it don't care 'cause this dont change the scancode.
Thanks to discord community who've helped me, especially AlamTaz for his patience.
So if I have understood correctly in SRB2/blob/master/libs/SDL2/include/SDL_keyboard.h
https://github.com/STJr/SRB2/blob/master/libs/SDL2/include/SDL_keyboard.h
I have (maybe not tried yet) to replace all mention to "SDL_Scancode" by "SDL_Keycode" in the file.
I'll give more info of this sacred quest :°)
Hello Folks,
I'm looking wich command I should use to rebind a key linto an other key.
By exemple I would like to bind A to type Q in chatrrom
I've try
Code:
bind a "Q"
Code:
bind a "q"
Code:
bind a "KEYq"
Code:
bind a "KEYQ"
But there is no change, here is some missing argument in my command ?
Many Thanks. :)
Ps : if you just want to compile srb2 on your linux debian system (or derivated as ubuntu, not sure for others gnu etc) jump to this post. :)
Last edited: