diff --git a/Makefile b/Makefile index c11e05d..f62d81d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ # st - simple terminal # See LICENSE file for copyright and license details. -include config_rs97.mk +include config_miyoo.mk SRC = st.c keyboard.c font.c msg_queue.c OBJ = ${SRC:.c=.o} -all: options st libst-preload.so sdl_test +all: options st libst-preload.so: st-preload.o msg_queue.o ${CC} -shared -o $@ $^ diff --git a/config.def.h b/config.def.h index f8425be..e3f25d8 100644 --- a/config.def.h +++ b/config.def.h @@ -18,7 +18,7 @@ static unsigned int doubleclicktimeout = 300; static unsigned int tripleclicktimeout = 600; /* TERM value */ -static char termname[] = "st-256color"; +static char termname[] = "xterm"; static unsigned int tabspaces = 4; #define WORD_BREAK " " diff --git a/config_miyoo.mk b/config_miyoo.mk index c2ce444..23974c8 100644 --- a/config_miyoo.mk +++ b/config_miyoo.mk @@ -13,9 +13,9 @@ LIBS = -lc -lutil # flags CPPFLAGS = -DVERSION=\"${VERSION}\" -CFLAGS += -g -Wall ${INCS} ${CPPFLAGS} -DRS97 -fPIC +CFLAGS += -g -Wall ${INCS} ${CPPFLAGS} -DMIYOO -fPIC INCLUDES = -Iinclude $(SDL_CFLAGS) -LDFLAGS = -Wl,--start-group -lSDL -lSDL_image -lpng -ljpeg -lasound -lSDL_mixer -lfreetype -lSDL_ttf -logg -lvorbisidec -lmikmod -lmodplug -lm -pthread -lz -lstdc++ $(EXTRA_LDFLAGS) -Wl,--end-group +LDFLAGS = -g -lSDL -lasound # compiler and linker CC = $(CROSS_COMPILE)gcc diff --git a/keyboard.c b/keyboard.c index d202eb1..0c32e33 100644 --- a/keyboard.c +++ b/keyboard.c @@ -4,6 +4,23 @@ #define NUM_ROWS 6 #define NUM_KEYS 18 +#ifdef MIYOO + +#define KEY_UP SDLK_UP +#define KEY_DOWN SDLK_DOWN +#define KEY_LEFT SDLK_LEFT +#define KEY_RIGHT SDLK_RIGHT +#define KEY_ENTER SDLK_LALT // A +#define KEY_TOGGLE SDLK_LCTRL // B +#define KEY_BACKSPACE SDLK_BACKSPACE // R +#define KEY_SHIFT SDLK_TAB // L +#define KEY_LOCATION SDLK_LSHIFT // Y +#define KEY_ACTIVATE SDLK_SPACE // X +#define KEY_QUIT SDLK_ESCAPE // SELECT +#define KEY_HELP SDLK_RETURN // START + +#else + //#ifdef RS97 #define KEY_UP SDLK_UP @@ -20,7 +37,6 @@ #define KEY_HELP SDLK_RETURN // START /*#else - #define KEY_UP SDLK_UP #define KEY_DOWN SDLK_DOWN #define KEY_LEFT SDLK_LEFT @@ -31,8 +47,8 @@ #define KEY_SHIFT SDLK_s #define KEY_LOCATION SDLK_l #define KEY_ACTIVATE SDLK_BACKQUOTE - -#endif*/ +*/ +#endif #define KMOD_SYNTHETIC (1 << 13) @@ -96,8 +112,8 @@ void init_keyboard() { char* help = "How to use:\n" " ARROWS: select key from keyboard\n" -" B: press key\n" -" A: toggle key (useful for shift/ctrl...)\n" +" A: press key\n" +" B: toggle key (useful for shift/ctrl...)\n" " L: shift\n" " R: backspace\n" " X: change keyboard location (top/bottom)\n" @@ -181,7 +197,7 @@ void update_modstate(int key, int state) { else if(key == SDLK_LMETA) mod_state |= KMOD_LMETA; else if(key == SDLK_RMETA) mod_state |= KMOD_RMETA; //else if(key == SDLK_NUM) mod_state |= KMOD_NUM; - else if(key == SDLK_CAPSLOCK) mod_state |= KMOD_CAPS; + //else if(key == SDLK_CAPSLOCK) mod_state |= KMOD_CAPS; else if(key == SDLK_MODE) mod_state |= KMOD_MODE; } else if(state == STATE_UP) { if(key == SDLK_LSHIFT) mod_state &= ~KMOD_LSHIFT; @@ -193,7 +209,7 @@ void update_modstate(int key, int state) { else if(key == SDLK_LMETA) mod_state &= ~KMOD_LMETA; else if(key == SDLK_RMETA) mod_state &= ~KMOD_RMETA; //else if(key == SDLK_NUM) mod_state &= ~KMOD_NUM; - else if(key == SDLK_CAPSLOCK) mod_state &= ~KMOD_CAPS; + //else if(key == SDLK_CAPSLOCK) mod_state &= ~KMOD_CAPS; else if(key == SDLK_MODE) mod_state &= ~KMOD_MODE; } SDL_SetModState(mod_state);