Re: [AD] keyconf without pckeys

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Fine with me. OSX Allegro gets the proper keycode translation directly
> from the OS, which is localized by the system preferences.

Nice!

> So no need for keyconf;attached patch #ifdefs the thing.

A little bit OSX-centric :-)

Now that you have pointed out the problem, we have to fix it on all affected 
platforms (Linux console and MacOS X). I commited the attached patch on 
mainline and branch.

-- 
Eric Botcazou
Index: setup/keyconf.c
===================================================================
RCS file: /cvsroot/alleg/allegro/setup/keyconf.c,v
retrieving revision 1.22
diff -u -r1.22 keyconf.c
--- setup/keyconf.c	30 Oct 2003 20:43:34 -0000	1.22
+++ setup/keyconf.c	1 Nov 2003 14:05:02 -0000
@@ -24,6 +24,9 @@
 #include "allegro/internal/aintern.h"
 
 
+/* The code can't link on platforms that don't use src/misc/pckeys.c (Linux console, MacOS X). */
+#if (defined ALLEGRO_DOS) || (defined ALLEGRO_WINDOWS) || (defined ALLEGRO_WITH_XWINDOWS) || (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS)
+
 
 char *scancode_name[] = 
 {
@@ -102,41 +105,9 @@
 unsigned short my_key_accent4_upper_table[KEY_MAX];
 
 
-#if (!defined ALLEGRO_DOS) && (!defined ALLEGRO_WINDOWS) && (!defined ALLEGRO_WITH_XWINDOWS) && (!defined ALLEGRO_QNX) && (!defined ALLEGRO_BEOS)
-
-   /* if this platform isn't using pckeys.c, we declare these ourselves */
-   int _key_accent1 = 0;
-   int _key_accent2 = 0;
-   int _key_accent3 = 0;
-   int _key_accent4 = 0;
-   int _key_accent1_flag = 0;
-   int _key_accent2_flag = 0;
-   int _key_accent3_flag = 0;
-   int _key_accent4_flag = 0;
-
-   int _key_standard_kb;
-
-   unsigned short *_key_ascii_table;
-   unsigned short *_key_capslock_table;
-   unsigned short *_key_shift_table;
-   unsigned short *_key_control_table;
-   unsigned short *_key_altgr_lower_table;
-   unsigned short *_key_altgr_upper_table;
-   unsigned short *_key_accent1_lower_table;
-   unsigned short *_key_accent1_upper_table;
-   unsigned short *_key_accent2_lower_table;
-   unsigned short *_key_accent2_upper_table;
-   unsigned short *_key_accent3_lower_table;
-   unsigned short *_key_accent3_upper_table;
-   unsigned short *_key_accent4_lower_table;
-   unsigned short *_key_accent4_upper_table;
-
-#endif
-
-
 char keyboard_name[64] = EMPTY_STRING;
 
-#define FILENAME_LENGTH (512)
+#define FILENAME_LENGTH  512
 char config_file[FILENAME_LENGTH] = EMPTY_STRING;
 
 unsigned short *editor_table;
@@ -1003,5 +974,19 @@
 
    return 0;
 }
+
+
+#else
+
+
+int main(void)
+{
+   allegro_init();
+   allegro_message("The KEYCONF utility is not needed on this platform.\n");
+   return 1;
+}
+
+
+#endif
 
 END_OF_MAIN();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/