Comments (10)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
- [iPad IOS 4.2.1 (greenpois0n rc5)]: Intermittent mouse and auto-rotation interaction HOT 6
- after crash cursor stays on screen HOT 1
- Mouse scroll is not working
- iPhone client dies when pressing home button or left mouse click
- iOS 7 Support HOT 27
- Can't Connect - "new client is unresponsive" HOT 4
- Stuck in Connecting...
- backspace not working HOT 1
- Cannot open iSynergy 0.9-2 on iPad 2 (5.1.1)
- iOS Synergy Client Crash on mouse entry HOT 8
- User cannot hide Synergy icon from menu bar HOT 2
- Feature: Keyboard Support HOT 55
- connection refused (36 HOT 1
- iPad not booting
- iphone 5 support (screen size) HOT 2
- random crashes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isynergyclient.