GithubHelp home page GithubHelp logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Sorry only now seen that the project is not supporting keyboard yet.
Still the orientation issue stands

Original comment by shemesh.mail on 7 Mar 2012 at 5:57

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
orientation support wasn't implemented either. of course, it would be good to 
have. :) (as well as keyboard support)

Original comment by [email protected] on 21 Mar 2012 at 4:37

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Here's a patch for orientation support below. I started looking at HID-SUPPORT 
as working it in seems really easy, but i couldn't get it integrated with the 
project and the doc is a little sparse (point me in the right direction and 
i'll circle back)

iPad 2 5.0.1 (greenpois0n jailbreak), I do still get a connection broken if 
start touching but implementation of HID-SUPPORT will probably fix that. : 
[SynergyClient handleSocketCallback] Connection broken!


Index: AppDelegate.m
===================================================================
--- AppDelegate.m   (revision 2)
+++ AppDelegate.m   (working copy)
@@ -63,9 +63,33 @@
    // NSLog(@"Screen width = %f, height = %f", screenBound.size.width, screenBound.size.height);
    [synergyClient setScreenWidth:screenBound.size.width andHeight:screenBound.size.height];

+    //saiyen
+    //Detect orientation change
+    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
+    [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(detectOrientation) 
name:@"UIDeviceOrientationDidChangeNotification" object:nil];
+    //saiyen
+    
+    
    return YES;
 }

+//saiyen
+-(void)detectOrientation{
+    UIScreen *screen = [UIScreen mainScreen];
+    CGRect fullScreenRect = screen.bounds; //implicitly in Portrait 
orientation.        
+    
+    if (UIInterfaceOrientationIsLandscape([[UIDevice currentDevice] 
orientation])) 
+    {
+        CGRect temp;
+        temp.size.width = fullScreenRect.size.height;
+        temp.size.height = fullScreenRect.size.width;
+        fullScreenRect = temp;      
+    }
+   [self.synergyClient setScreenWidth:fullScreenRect.size.width 
andHeight:fullScreenRect.size.height];
+    [self.synergyClient sendResetOptionsMessage];
+}
+//saiyen
+
 - (void)applicationWillTerminate:(UIApplication *)application{
    [configViewController updateDefaultsFromView];
 }
Index: SynergyClient.h
===================================================================
--- SynergyClient.h (revision 2)
+++ SynergyClient.h (working copy)
@@ -84,6 +84,9 @@

 -(BOOL) openConnection:(NSString *) remote;
 -(void) handleSocketCallback;
+//saiyen
+- (void) sendResetOptionsMessage;
+//saiyen
 -(void) handleMessageWithLen:(uint16_t)len;
 -(NSString *) connectionStatus;
 -(BOOL) isConnecting;
Index: SynergyClient.m
===================================================================
--- SynergyClient.m (revision 2)
+++ SynergyClient.m (working copy)
@@ -44,7 +44,7 @@
 #include <dlfcn.h>

 #include "mouse_msgs.h"

 NSString *keyServerAddress = @"ServerAddress";
 NSString *keyClientName    = @"ClientName";
@@ -485,6 +485,17 @@
    }
 }

+//saiyen
+//send a screensaver ended message to cause the server to re-query screen 
resolution.
+- (void) sendResetOptionsMessage {
+   if (clientState == STATE_CONNECTED || clientState == STATE_LIVE) {
+        [self deactivateMouse];
+        [self writeMessage:kMsgDInfo, 0, 0, screenWidth, screenHeight, 
screenWidth/2, screenHeight/2];
+        [self activateMouse];
+   }
+}
+//saiyen
+
 - (void) handleMessageWithLen:(uint16_t)len {

    static int mouseButton = 0;
@@ -494,7 +505,7 @@
    static int ctrlDown = 0;
    // int ok;

-   // NSLog(@"Message: '%s'\n", message);
+    NSLog(@"Message: '%s'\n", message);
    // [self hexdump:len];

    if (strncmp("Synergy", (char*)message, 7) == 0){
@@ -520,26 +531,26 @@
    if (strncmp(kMsgDKeyDown, (char*)message, 4) == 0){
        int a1, a2, a3;
        [self parseMessage:kMsgDKeyDown, &a1, &a2, &a3];
-       // NSLog(@("kMsgDKeyDown ID %04x, MASK %04x, BUTTON %04x\n", a1, a2, a3);
+        NSLog(@"kMsgDKeyDown ID %04x, MASK %04x, BUTTON %04x\n", a1, a2, a3);
        if (a1 == 0xefe1) {
            shiftDown = 1;
        }
        if (a1 == 0xefe3) {
            ctrlDown = 1;
        }
-       // NSLog(@("CtrlActive = %u, ShiftActive = %u\n", ctrlDown, shiftDown);
+        NSLog(@"CtrlActive = %u, ShiftActive = %u\n", ctrlDown, shiftDown);
    }       
    if (strncmp(kMsgDKeyUp, (char*)message, 4) == 0){
        int a1, a2, a3;
        [self parseMessage:kMsgDKeyUp, &a1, &a2, &a3];
-       // NSLog(@("kMsgDKeyUp ID %04x, MASK %04x, BUTTON %04x\n", a1, a2, a3);
+        NSLog(@"kMsgDKeyUp ID %04x, MASK %04x, BUTTON %04x\n", a1, a2, a3);
        if (a1 == 0xefe1) {
            shiftDown = 0;
        }
        if (a1 == 0xefe3) {
            ctrlDown = 0;
        }
-       // NSLog(@("CtrlActive = %u, ShiftActive = %u\n", ctrlDown, shiftDown);
+        NSLog(@"CtrlActive = %u, ShiftActive = %u\n", ctrlDown, shiftDown);
    }       
    if (strncmp(kMsgDMouseMove, (char*)message, 4) == 0){
        int x, y;
@@ -580,13 +591,13 @@
                NSString *currentMode = [activator currentEventMode];
                event = [[[laEventClass alloc] initWithName:eventName mode:currentMode] autorelease];
            } else {
-               // NSLog(@"Activator other button %u", button);
+                NSLog(@"Activator other button %u", button);
            }
            if (event) {
-               // NSLog(@"Activator event %@", eventName);
+                NSLog(@"Activator event %@", eventName);
                [activator sendEventToListener:event];
            } else {
-               // NSLog(@"event creation failed");
+                NSLog(@"event creation failed");
            }
        }

@@ -597,14 +608,14 @@
            mouseButton = 0;
        }
        mouseSendEvent( mouseX, mouseY, mouseButton);
-       // NSLog(@("Mouse down %u at %f,%f\n", button, mouseX, mouseY);
+        NSLog(@"Mouse down %u at %f,%f\n", button, mouseX, mouseY);
    }
    if (strncmp(kMsgDMouseUp, (char*)message, 4) == 0){
        int i;
        [self parseMessage:kMsgDMouseUp, &i];
        mouseButton = 0;
        mouseSendEvent( mouseX, mouseY, mouseButton);
-       // NSLog(@("Mouse up %u at %f,%f\n", i, mouseX, mouseY);
+        NSLog(@"Mouse up %u at %f,%f\n", i, mouseX, mouseY);
    }
    if (strncmp(kMsgCEnter, (char*)message, 4) == 0){
        // connected
Index: mouse_msgs.mm
===================================================================
--- mouse_msgs.mm   (revision 2)
+++ mouse_msgs.mm   (working copy)
@@ -78,8 +78,35 @@
     if (mouseMessagePort) {
         // Create and send message
         MouseEvent event;
-        event.x = x;
-        event.y = y;
+        
+        //saiyen
+        //Get orientation, if orientation is landscape, switch x and y 
optionally invert
+        UIScreen *screen = [UIScreen mainScreen];
+        CGRect fullScreenRect = screen.bounds; //implicitly in Portrait 
orientation.        
+        
+        if (UIInterfaceOrientationIsLandscape([[UIDevice currentDevice] 
orientation])) 
+        {
+            CGRect temp;
+            temp.size.width = fullScreenRect.size.height;
+            temp.size.height = fullScreenRect.size.width;
+            fullScreenRect = temp;      
+        }
+
+        if (([[UIDevice currentDevice] orientation] == 
UIDeviceOrientationLandscapeLeft)) {
+            event.x = fullScreenRect.size.height-y;
+            event.y = x;
+        }else if(([[UIDevice currentDevice] orientation] == 
UIDeviceOrientationLandscapeRight)){
+            event.x = y;
+            event.y = fullScreenRect.size.width-x;
+        }else if (([[UIDevice currentDevice] orientation] == 
UIDeviceOrientationPortraitUpsideDown)) {
+            event.x = fullScreenRect.size.width-x;
+            event.y = fullScreenRect.size.height-y;
+        }else{
+            event.x = x;
+            event.y = y;
+        }
+        //saiyen
+        
         event.absolute = YES;
         event.buttons = buttons;


Original comment by [email protected] on 23 May 2012 at 9:12

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Thanks for the patch! That's the first since I've posted the code here more 
than a year ago. I'll try to integrate this and push an update.

hid-support should be very easy to use given the hid-support.h header file. see 
hidsupport test subproject for an example. It still doesn't show a mouse 
pointer tough.

Original comment by [email protected] on 25 May 2012 at 11:44

  • Changed title: Feature: handle orientation changes
  • Changed state: Accepted

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
would love to see this and the keyboard support patch implemented and pushed to 
cydia!

lovely work :)

Original comment by [email protected] on 9 Jun 2012 at 4:49

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Any thoughts on when this will be available in Cydia?  The angle is awkward and 
balance is precarious when I use the smart cover to stand this thing up as 
portrait.

Original comment by [email protected] on 6 Jul 2012 at 9:36

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Such a cool app. I'll be the one who requests an update to the deb this month 
;-)

I tried to build the code with the above patch myself to no avail. Please 
Matthias/Super Saiyan share a binary somewhere

Original comment by [email protected] on 12 Aug 2012 at 6:53

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Keyboard support would be great, but landscape support is more important. I'm 
also having a little trouble building this myself, so a binary would be awesome!

Original comment by DanH1420 on 15 Feb 2013 at 10:57

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Primarily Landscape please!   And then keyboard support would be nice!

Please!? or point us somewhere to download the compiled deb.

Cheers!

Original comment by fiefie on 21 Mar 2013 at 7:49

from isynergyclient.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I uploaded a deb in the other issue thread. 
https://code.google.com/p/isynergyclient/issues/detail?id=5#c23

Original comment by [email protected] on 8 May 2013 at 2:13

from isynergyclient.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.