From 1bee4012b158945bbb9b1dbf58c6acf363063c08 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Fri, 25 Mar 2005 09:38:24 +0000 Subject: [PATCH] * keyxdef.c: Constify struct qnx_key_define_s typedef. * key.c (get_modifier): Fixed dynamic loading of the Photon library for shift keys, only current version of libph used now. (qansi_key_defines): Swapped Gray '-' and '+' codes definitions, due to fixed bugs in the QNX6's console driver. --- src/ChangeLog | 15 +++++++++++++-- src/key.c | 19 +++++-------------- src/keyxdef.c | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6ad637e5..51a8b5234 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,15 @@ -2004-03-23 Pavel S. Shirshov +2005-03-25 Andrew V. Samoilov + + * keyxdef.c: Constify struct qnx_key_define_s typedef. + +2005-03-25 Mike Gorchak + + * key.c (get_modifier): Fixed dynamic loading of the Photon library for + shift keys, only current version of libph used now. + (qansi_key_defines): Swapped Gray '-' and '+' codes definitions, due to + fixed bugs in the QNX6's console driver. + +2005-03-23 Pavel S. Shirshov * util.c (load_file_position): Fix mcedit position save bug. Read a number after ';'. @@ -81,7 +92,7 @@ * screen.c: Reverted my changes from 2005-02-08 (except the maybe_cd calls) to not confuse the upcoming UTF-8 patches. -2004-02-12 Andrew V. Samoilov +2005-02-12 Andrew V. Samoilov * glibcompat.c: Add g_strlcat() declaration for glib 1.2.x diff --git a/src/key.c b/src/key.c index 642d7a1f0..5d9990e84 100644 --- a/src/key.c +++ b/src/key.c @@ -381,8 +381,8 @@ static key_define_t qansi_key_defines[] = {KEY_M_ALT | 'x', ESC_STR "Nx", MCKEY_NOACTION}, /* Alt-x */ {KEY_M_ALT | 'y', ESC_STR "Ny", MCKEY_NOACTION}, /* Alt-y */ {KEY_M_ALT | 'z', ESC_STR "Nz", MCKEY_NOACTION}, /* Alt-z */ - {KEY_KP_ADD, ESC_STR "[S", MCKEY_NOACTION}, /* Gr-Plus */ - {KEY_KP_SUBTRACT, ESC_STR "[T", MCKEY_NOACTION}, /* Gr-Minus */ + {KEY_KP_SUBTRACT, ESC_STR "[S", MCKEY_NOACTION}, /* Gr-Minus */ + {KEY_KP_ADD, ESC_STR "[T", MCKEY_NOACTION}, /* Gr-Plus */ {0, 0, MCKEY_NOACTION}, }; @@ -1273,10 +1273,7 @@ get_modifier (void) int mod_status, shift_ext_status; static int in_photon = 0; static int ph_ig = 0; - char phlib_path[PATH_MAX]; PhCursorInfo_t cursor_info; - static void *ph_handle; - char *ph_env; #endif /* __QNXNTO__ */ #ifdef HAVE_TEXTMODE_X11_SUPPORT @@ -1302,12 +1299,9 @@ get_modifier (void) /* First time here, let's load Photon library and attach to Photon */ in_photon = -1; - ph_env = getenv ("PHOTON2_PATH"); - if (ph_env != NULL) { - g_snprintf (phlib_path, sizeof (phlib_path), - "%s/lib/libph.so.1", ph_env); + if (getenv ("PHOTON2_PATH") != NULL) { /* QNX 6.x has no support for RTLD_LAZY */ - ph_handle = dlopen (phlib_path, RTLD_NOW); + void *ph_handle = dlopen ("/usr/lib/libph.so", RTLD_NOW); if (ph_handle != NULL) { ph_attach = (ph_dv_f) dlsym (ph_handle, "PhAttach"); ph_input_group = @@ -1365,12 +1359,9 @@ get_modifier (void) result |= KEY_M_ALT; if (modifiers & CONTROL_PRESSED) result |= KEY_M_CTRL; - - return result; } -#else - return result; #endif /* !__linux__ */ + return result; } static void k_dispose (key_def *k) diff --git a/src/keyxdef.c b/src/keyxdef.c index ab377440d..509bc9bcd 100644 --- a/src/keyxdef.c +++ b/src/keyxdef.c @@ -282,7 +282,7 @@ #ifdef __USE_QNX_TI /* OS/implementation specific key-define struct */ -typedef struct qnx_key_define_s { +typedef const struct qnx_key_define_s { int mc_code; int str_idx; } qnx_key_define_t;