[haiku-commits] BRANCH jessicah-github.synergy [e0b88fa] src/add-ons/input_server/devices/synergy

  • From: jessicah-github.synergy <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 30 Sep 2014 13:01:35 +0200 (CEST)

added 1 changeset to branch 'refs/remotes/jessicah-github/synergy'
old head: 542fbdab8ea73fe62596c3d3e6393c2e20ccacb1
new head: e0b88faae29e4f09ce24b8c16182d4a0a739b518
overview: https://github.com/jessicah/haiku/compare/542fbda...e0b88fa

----------------------------------------------------------------------------

e0b88fa: synergy: fix use of fServerAddress; fix "high" scancodes

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Commit:      e0b88faae29e4f09ce24b8c16182d4a0a739b518
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Tue Sep 30 10:45:36 2014 UTC

----------------------------------------------------------------------------

2 files changed, 13 insertions(+), 4 deletions(-)
.../input_server/devices/synergy/haiku-usynergy.cpp   | 15 ++++++++++++---
.../input_server/devices/synergy/haiku-usynergy.h     |  2 +-

----------------------------------------------------------------------------

diff --git a/src/add-ons/input_server/devices/synergy/haiku-usynergy.cpp 
b/src/add-ons/input_server/devices/synergy/haiku-usynergy.cpp
index 4f7ad18..69d3da6 100644
--- a/src/add-ons/input_server/devices/synergy/haiku-usynergy.cpp
+++ b/src/add-ons/input_server/devices/synergy/haiku-usynergy.cpp
@@ -280,7 +280,10 @@ uSynergyInputServerDevice::_UpdateSettings()
                return;
 
        fEnableSynergy = get_driver_boolean_parameter(handle, "enable", false, 
false);
-       fServerAddress = get_driver_parameter(handle, "server", NULL, NULL);
+       const char *server = get_driver_parameter(handle, "server", NULL, NULL);
+       TRACE("synergy: settings: enable = %s, server = %s\n", fEnableSynergy ? 
"yes" : "no", server == NULL ? "(null)" : server);
+       if (server != NULL)
+               fServerAddress.SetTo(server);
 
        unload_driver_settings(handle);
 }
@@ -315,14 +318,15 @@ uSynergyConnectHaiku(uSynergyCookie cookie)
        CALLED();
        uSynergyInputServerDevice *inputDevice = 
(uSynergyInputServerDevice*)cookie;
 
-       if (inputDevice->fServerAddress == NULL || inputDevice->fEnableSynergy 
== false)
+       if (inputDevice->fServerAddress.Length() == 0 || 
inputDevice->fEnableSynergy == false)
                goto exit;
 
        struct sockaddr_in server;
 
        server.sin_family = AF_INET;
        server.sin_port = htons(24800);
-       inet_aton(inputDevice->fServerAddress, &server.sin_addr);
+       inet_aton(inputDevice->fServerAddress.String(), &server.sin_addr);
+       TRACE("synergy: connecting to %s:%d\n", 
inputDevice->fServerAddress.String(), 24800);
 
        inputDevice->synergyServerSocket = socket(PF_INET, SOCK_STREAM, 0);
 
@@ -502,6 +506,11 @@ uSynergyInputServerDevice::_ProcessKeyboard(uint16_t 
scancode, uint16_t _modifie
        uint32_t keycode = 0;
        if (scancode > 0 && scancode < sizeof(kATKeycodeMap)/sizeof(uint32))
                keycode = kATKeycodeMap[scancode - 1];
+       else {
+               scancode = (uint8)(scancode | 0x80);
+               if (scancode > 0 && scancode < 
sizeof(kATKeycodeMap)/sizeof(uint32))
+                       keycode = kATKeycodeMap[scancode - 1];
+       }
        TRACE("synergy: keycode = 0x%x\n", keycode);
 
        if (keycode < 256) {
diff --git a/src/add-ons/input_server/devices/synergy/haiku-usynergy.h 
b/src/add-ons/input_server/devices/synergy/haiku-usynergy.h
index 1327351..cd33342 100644
--- a/src/add-ons/input_server/devices/synergy/haiku-usynergy.h
+++ b/src/add-ons/input_server/devices/synergy/haiku-usynergy.h
@@ -64,7 +64,7 @@ class uSynergyInputServerDevice : public BHandler, public 
BInputServerDevice {
                uint32          fControlKey;
                char*           fFilename;
                bool            fEnableSynergy;
-               const char*     fServerAddress;
+               BString         fServerAddress;
 
        volatile bool   fUpdateSettings;
 


Other related posts:

  • » [haiku-commits] BRANCH jessicah-github.synergy [e0b88fa] src/add-ons/input_server/devices/synergy - jessicah-github . synergy