Use KEY_NONE for buttons without key shortcuts
SDLK_LAST was used, but it is SDL 1.x specific
This commit is contained in:
parent
fb51c1bb1c
commit
5c761ace2c
@ -1355,12 +1355,12 @@ void Button_Skins(int btn)
|
||||
Window_dropdown_add_item(cursor_dropdown, temp, cursors[temp]);
|
||||
|
||||
Window_set_normal_button(172, 87, 14, 14,
|
||||
(Config.Display_image_limits)?"X":" ", -1, 1, SDLK_LAST); // 8
|
||||
(Config.Display_image_limits)?"X":" ", -1, 1, KEY_NONE); // 8
|
||||
Print_in_window( 190, 85,"Draw picture", MC_Dark, MC_Light);
|
||||
Print_in_window( 190, 94,"limits", MC_Dark, MC_Light);
|
||||
|
||||
Window_set_normal_button(172, 111, 14, 14,
|
||||
(Config.Separate_colors)?"X":" ", -1, 1, SDLK_LAST); // 9
|
||||
(Config.Separate_colors)?"X":" ", -1, 1, KEY_NONE); // 9
|
||||
Print_in_window( 190, 109,"Separate", MC_Dark, MC_Light);
|
||||
Print_in_window( 190, 118,"colors", MC_Dark, MC_Light);
|
||||
|
||||
@ -1978,7 +1978,7 @@ void Button_Resolution(int btn)
|
||||
|
||||
// 10 little buttons for the state of each visible mode
|
||||
for (temp=0; temp<MODELIST_LINES && temp < Nb_video_modes; temp++)
|
||||
Window_set_normal_button(17,86+(temp<<3),13,7,"",0,1,SDLK_LAST);// 8..17
|
||||
Window_set_normal_button(17,86+(temp<<3),13,7,"",0,1,KEY_NONE);// 8..17
|
||||
|
||||
// Dummy buttons as explainations of colors
|
||||
Window_draw_normal_bouton( 16,170,13,7,"",0,0);
|
||||
@ -2934,7 +2934,7 @@ void Button_Paintbrush_menu(int btn)
|
||||
{
|
||||
x_pos=13+(index%12)*24;
|
||||
y_pos=27+(index/12)*25;
|
||||
//Window_set_normal_button(x_pos ,y_pos ,20,20,"",0,1,SDLK_LAST);
|
||||
//Window_set_normal_button(x_pos ,y_pos ,20,20,"",0,1,KEY_NONE);
|
||||
Window_set_dropdown_button(x_pos ,y_pos ,20,20,28,NULL, 0,0,0,RIGHT_SIDE,0);
|
||||
Window_dropdown_add_item(Window_dropdown_button_list, 1, "Set");
|
||||
// Highlight selected brush
|
||||
@ -4997,8 +4997,8 @@ void Button_Text(int btn)
|
||||
|
||||
// Taille texte
|
||||
input_size_button = Window_set_input_button_s(220,43,3,SDLK_s); // 7
|
||||
Window_set_repeatable_button(202,43,13,11,"-",0,1,SDLK_LAST); // 8
|
||||
Window_set_repeatable_button(251,43,13,11,"+",0,1,SDLK_LAST); // 9
|
||||
Window_set_repeatable_button(202,43,13,11,"-",0,1,KEY_NONE); // 8
|
||||
Window_set_repeatable_button(251,43,13,11,"+",0,1,KEY_NONE); // 9
|
||||
|
||||
// Preview
|
||||
preview_button = Window_set_special_button(8,106,273,50,0); // 10
|
||||
@ -5593,7 +5593,8 @@ void Button_Brush_container(void)
|
||||
y_pos,
|
||||
BRUSH_CONTAINER_PREVIEW_WIDTH+2,
|
||||
BRUSH_CONTAINER_PREVIEW_HEIGHT+2,
|
||||
"",0,1,SDLK_LAST);
|
||||
"",0,1,KEY_NONE
|
||||
);
|
||||
Display_stored_brush_in_window(x_pos+1, y_pos+1, index);
|
||||
}
|
||||
Update_window_area(0,0,Window_width, Window_height);
|
||||
|
||||
@ -629,7 +629,7 @@ void Button_Smooth_menu(void)
|
||||
Window_display_frame(6,17,130,37);
|
||||
for (x=11,y=0; y<4; x+=31,y++)
|
||||
{
|
||||
Window_set_normal_button(x,22,27,27,"",0,1,SDLK_LAST); // 3,4,5,6
|
||||
Window_set_normal_button(x,22,27,27,"",0,1,KEY_NONE); // 3,4,5,6
|
||||
for (j=0; j<3; j++)
|
||||
for (i=0; i<3; i++)
|
||||
Print_char_in_window(x+2+(i<<3),24+(j<<3),'0'+Smooth_default_matrices[y][i][j],MC_Black,MC_Light);
|
||||
|
||||
@ -1652,7 +1652,7 @@ byte Button_Load_or_Save(T_Selector_settings *settings, byte load, T_IO_Context
|
||||
Print_in_window(292,59,")",MC_Dark,MC_Light);
|
||||
|
||||
// Selecteur de Lecteur / Volume
|
||||
Window_set_normal_button(7,18,53,23,"",0,1,SDLK_LAST); // 9
|
||||
Window_set_normal_button(7,18,53,23,"",0,1,KEY_NONE); // 9
|
||||
Print_in_window(10,22,"Select",MC_Black,MC_Light);
|
||||
Print_in_window(14,30,"drive",MC_Black,MC_Light);
|
||||
|
||||
|
||||
18
src/global.h
18
src/global.h
@ -779,6 +779,8 @@ GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE
|
||||
|
||||
/// Indicates "no keyboard shortcut".
|
||||
#define KEY_NONE 0
|
||||
|
||||
#if defined(USE_SDL)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse 3rd button.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
@ -798,6 +800,18 @@ GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_JOYBUTTON (SDLK_LAST+4)
|
||||
|
||||
#else
|
||||
// Not SDL 1.2
|
||||
#define KEY_MOUSEMIDDLE 0x0210
|
||||
#define KEY_MOUSEX1 0x0211
|
||||
#define KEY_MOUSEX2 0x0212
|
||||
#define KEY_MOUSEWHEELUP 0x0200
|
||||
#define KEY_MOUSEWHEELDOWN 0x0201
|
||||
#define KEY_MOUSEWHEELLEFT 0x0202
|
||||
#define KEY_MOUSEWHEELRIGHT 0x0203
|
||||
#define KEY_JOYBUTTON 0x0100
|
||||
#endif
|
||||
|
||||
/// The joystick axis are {X,Y} - on all platforms so far.
|
||||
/// If there is ever a platform where they are reversed, put
|
||||
/// these lines in each platform "case" below.
|
||||
@ -870,12 +884,14 @@ GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE
|
||||
#define JOY_BUTTON_JOY (10)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_HOME)
|
||||
#else
|
||||
#elif defined(USE_SDL) || defined(USE_SDL2)
|
||||
///
|
||||
/// This is the key identifier for ESC. When hard-coding keyboard shortcuts
|
||||
/// for buttons, etc. we use this instead of SDLK_ESCAPE,
|
||||
/// so the console ports can get a joybutton equivalent of it.
|
||||
#define KEY_ESC SDLK_ESCAPE
|
||||
#else
|
||||
#define KEY_ESC 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -19,6 +19,9 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
#include "struct.h"
|
||||
#include "global.h"
|
||||
#include "hotkeys.h"
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
#else
|
||||
#define bool char
|
||||
#endif
|
||||
#include <SDL.h>
|
||||
|
||||
#define NB_SHORTCUTS 212 ///< Number of actions that can have a key combination associated to it.
|
||||
|
||||
|
||||
@ -2923,7 +2923,7 @@ void Button_Secondary_palette(int btn)
|
||||
Num2str(RGB_scale,str,3);
|
||||
Print_in_window(RGBScale_X,RGBScale_Y,str,MC_Black,MC_Light);
|
||||
|
||||
Window_set_normal_button(35,106,13,11,"",-1,1,SDLK_LAST); // 8
|
||||
Window_set_normal_button(35,106,13,11,"",-1,1,KEY_NONE); // 8
|
||||
Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light);
|
||||
Print_in_window(51,108,"Vertical",MC_Dark,MC_Light);
|
||||
|
||||
|
||||
@ -123,9 +123,9 @@ void Button_Transform_menu(int btn)
|
||||
Window_set_normal_button( 17,140, 27,14,"Y\022" ,1,1,SDLK_y); // 3
|
||||
|
||||
Print_in_window( 84,114,"Rotate",MC_Dark,MC_Light);
|
||||
Window_set_normal_button( 69,125, 37,14,"-90\xb0" ,0,1,SDLK_LAST); // 4
|
||||
Window_set_normal_button(107,125, 37,14,"+90\xb0" ,0,1,SDLK_LAST); // 5
|
||||
Window_set_normal_button( 69,140, 75,14,"180\xb0" ,0,1,SDLK_LAST); // 6
|
||||
Window_set_normal_button( 69,125, 37,14,"-90\xb0" ,0,1,KEY_NONE); // 4
|
||||
Window_set_normal_button(107,125, 37,14,"+90\xb0" ,0,1,KEY_NONE); // 5
|
||||
Window_set_normal_button( 69,140, 75,14,"180\xb0" ,0,1,KEY_NONE); // 6
|
||||
|
||||
Print_in_window( 87, 19,"Resize",MC_Dark,MC_Light);
|
||||
Window_set_normal_button( 80, 86, 60,14,"RESIZE",1,1,SDLK_r); // 7
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user