webOS Nation Forums >  Homebrew >  webOS patches > KeyToss Global Orientation Control
KeyToss Global Orientation Control

  Reply
 
LinkBack Thread Tools Display Modes
Old 01/01/2010, 10:10 PM   #1 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default [patch] KeyToss Orientation Manager

Switch between landscape and portrait by tapping the gesture area or using the slider. Works for apps that already allow landscape mode, or are patched to do so.
This patch is free, but not open source.
No donations are accepted.




UPDATE 8: Patch updated for webOS 1.4.5.




UPDATE: This patch now uses resources *much* more efficiently.
UPDATE 2: Fixed email and messaging search problem *again*.
UPDATE 3: Changed initialization process to prevent problem with video and YouTube apps.
UPDATE 4: Patch updated for 1.4.0.
Additional Landscape patches for Email, Messaging, and YouTube still work. Camera patch does not.
UPDATE 5: Added link to mamouton's updated camera patch for 1.4.0
UPDATE 6: Orientation patch and landscape messaging patch updated to be compatible with 1.4.1.1.
UPDATE 7: Saves orientation lock state between app launches.


Controls
  1. Triple-tap (quickly) in the gesture area to switch between portrait and landscape, and lock orientation.
  2. Double-tap, followed quickly by a single-tap to unlock and update orientation.
  3. Open slider to switch to portrait mode, and lock orientation.
  4. Close slider to unlock and update orientation.


Initialization
When patch is installed, it will work with the Browser and Photos apps by default.

To initialize the Orientation Manager on any other app, tilt the top of the screen downward (or just turn the screen upside-down), and press the gesture area and the 'o' key on the keyboard. A notification message should appear. Then restart the app.

To deactivate it for any app, do the same thing.

Note that some apps are slow to detect an orientation change. If the Pre doesn't detect that it's tilted downward, this won't work. Also, the camera app won't show the notification message unless you swipe up to shrink the card.


Notes
  • Requires webOS 1.4.5.
  • Works with browser and photos natively.
  • Compatible with camera app and Flashcards app.
  • Compatible with landscape patch for PDF Viewer app.
  • For email, messaging, and YouTube apps, requires the new landscape patches below.
  • Taps control only the active app. The slider controls all apps.
  • Taps must be distinct, and the led must light up three times.
  • Compatible with virtual keyboard patch. A slow double-tap opens the keyboard, while fast taps are intercepted by this patch.
  • This patch is not compatible with the original camera patch which allows any key to take a picture - because tapping the gesture area takes a picture. EDIT: A revised camera patch is linked below.
  • This patch also does not work with the browser orientation block patch.


Please use this thread to note issues with app compatibility or performance. Controls may change in future versions.


Save the following files (e.g., "Save Link As") onto your computer, and install with WebOS QuickInstall. Do NOT copy and paste the text into a new file because that often breaks patches.

KeyToss Orientation Control Patch
(updated 8/17/10 for webOS 1.4.5)


The following landscape patches are distributed under MIT license.

Email Landscape Patch
(updated 1/2/10)

Messaging Landscape Patch - based on patch by fritos1406
(updated 4/2/10 for 1.4.1.1)

YouTube Landscape Patch - based on patch by fritos1406

EDIT:
Camera Any Key Capture Patch - updated for 1.4.0 by mamouton
(updated 3/24/10)

For Developers:
If you want your app or patch to be compatible with this patch, please do not use:
this.controller.window.PalmSystem.setWindowOrientation();
Instead, use:
this.controller.stageController.setWindowOrientation();

They do exactly the same thing, except this patch can intercept the latter.


Also, if you develop an app which requires simple orientation changes (portrait/landscape), do NOT set up a listener for "orientationchange". This will continually call your method regardless of whether the device moves. The documentation doesn't mention this.

I came across this problem in a third-party app when I was debugging this patch.

Last edited by samkim; 01/16/2011 at 12:57 AM.
samkim is offline   Reply With Quote
Old 01/01/2010, 11:30 PM   #2 (permalink)
Member
 
fritos1406's Avatar
 
Join Date: Jul 2009
Posts: 1,307
Likes Received: 1
Thanks: 34
Thanked 462 Times in 187 Posts
Default

Dudeeeee!!!! Ur awesome
__________________

Donate Via Paypal to Email Adress: silent2205@gmail.com
Email: fritos1406@aim.com
Twitter: @fritos1406

Last edited by fritos1406; 01/01/2010 at 11:51 PM.
fritos1406 is offline   Reply With Quote
Old 01/01/2010, 11:55 PM   #3 (permalink)
Member
 
Join Date: Oct 2009
Posts: 126
Likes Received: 0
Thanks: 11
Thanked 7 Times in 4 Posts
Default

<3
Much Respect man wow good work
BronTron is offline   Reply With Quote
Old 01/02/2010, 02:51 PM   #4 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Thanks.

Here's a new camera patch which allows you to take pictures with any key on the keyboard, but not with a tap in the gesture area.

Camera Any Key Capture Patch- based on patch by fritos1406
EDIT: I've added this link to the first post.

I've also fixed a bug in the global orientation patch which interfered with the keyboard in the camera app.

Last edited by samkim; 01/02/2010 at 08:38 PM.
samkim is offline   Reply With Quote
Old 01/02/2010, 04:02 PM   #5 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

sakim the email landscape patch you have up here breaks my email. I can get to the screen with all my accounts but I can't open up the accounts to get to the inboxes.
__________________
My contributions to customizing the Palm Pre.

Browser Mega Mix|Email Mega Mix|Additional Sync Days|
Disable Various Phone Sounds|Priority Discard Buttons|

Sign up for SugarSync Get 500MB extra space
Sign up for Dropbox Get 250MB extra space
mamouton is offline   Reply With Quote
Old 01/02/2010, 04:40 PM   #6 (permalink)
Member
 
Join Date: Oct 2009
Location: London
Posts: 457
Likes Received: 1
Thanks: 59
Thanked 48 Times in 29 Posts
Default

Quote:
Originally Posted by mamouton View Post
sakim the email landscape patch you have up here breaks my email. I can get to the screen with all my accounts but I can't open up the accounts to get to the inboxes.
Me too. Also, the (global) patch disables type to search in apps, for example typing in an email subject in the Email app or typing in a contact name in the Messaging app to find the appropriate conversation.

Also, it may have been my imagination but I think that this patch caused my Pre to be noticeably laggier and slower than before...

I've uninstalled this patch and am going back to the "Slider Disables Orientation Change," patch for just now; hopefully these issues (particularly the type to search one) can be fixed, as this is a great patch idea, and I found the controls' implementations really good whilst it was installed!

Last edited by StevenX; 01/02/2010 at 05:08 PM.
StevenX is offline   Reply With Quote
Old 01/02/2010, 05:12 PM   #7 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

The message problem is related to sms per contact patch. I just informed elryon about it so he could look at it. I had removed all the patches related to messaging and still couldn't do the global search in messages removed sms per contact and I could search.
__________________
My contributions to customizing the Palm Pre.

Browser Mega Mix|Email Mega Mix|Additional Sync Days|
Disable Various Phone Sounds|Priority Discard Buttons|

Sign up for SugarSync Get 500MB extra space
Sign up for Dropbox Get 250MB extra space
mamouton is offline   Reply With Quote
Old 01/02/2010, 05:43 PM   #8 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

The problem with the search was caused by an error in the code in the first version of the orientation patch. It was interfering with the keyboard input in certain circumstances. When I fixed the patch for the camera app, that was fixed as well. I just reinstalled the first version of the orientation patch to confirm that was the case.

My email app works fine for me. I suspect that it's a conflict with another patch. I'll test out the other patches and report back.

As for the lagginess, I haven't noticed any slowdown, but it's possible... This patch creates an instance of itself for every card that's opened, regardless of whether the app runs in landscape mode. As I mentioned, I do need to make this run more efficiently. I suggest restarting your phone (not just Luna) to completely clear out memory in case you have other memory problems.
samkim is offline   Reply With Quote
Old 01/02/2010, 06:48 PM   #9 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

Thanks for your quick response. I really like the work you do with the patches. To be clear I need to reapply the orientation patch and then download the patches in this thread for email, messaging and camera correct?
__________________
My contributions to customizing the Palm Pre.

Browser Mega Mix|Email Mega Mix|Additional Sync Days|
Disable Various Phone Sounds|Priority Discard Buttons|

Sign up for SugarSync Get 500MB extra space
Sign up for Dropbox Get 250MB extra space
mamouton is offline   Reply With Quote
Old 01/02/2010, 07:04 PM   #10 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

works great, it seems like ti takes a while for the camera to be responsive to take pictures.
__________________
My contributions to customizing the Palm Pre.

Browser Mega Mix|Email Mega Mix|Additional Sync Days|
Disable Various Phone Sounds|Priority Discard Buttons|

Sign up for SugarSync Get 500MB extra space
Sign up for Dropbox Get 250MB extra space
mamouton is offline   Reply With Quote
Old 01/02/2010, 07:05 PM   #11 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Quote:
Originally Posted by mamouton View Post
Thanks for your quick response. I really like the work you do with the patches. To be clear I need to reapply the orientation patch and then download the patches in this thread for email, messaging and camera correct?
The patches are independent of each other. So you just need to remove and reinstall the orientation patch (assuming you originally installed the first version and not the updated one).

Btw, what email patches do you have installed? I'm having trouble locating the conflicting patch.
samkim is offline   Reply With Quote
Old 01/02/2010, 07:16 PM   #12 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Ok, I found the problem with the email patch. Because I stripped out all but one of the context lines (before and after the inserted lines) in the patch, it was inserting the new line in the wrong place when another patch (Read/Delete All, and maybe others) was already installed. The reason I was having trouble locating the problem is that it occurred only when my patch was installed last.

I'll have time to fix it later tonight.
samkim is offline   Reply With Quote
Old 01/02/2010, 07:18 PM   #13 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

I just checked my email and it isn't working. I see your post, I will uninstall the email patch until it gets fixed. Thanks!
__________________
My contributions to customizing the Palm Pre.

Browser Mega Mix|Email Mega Mix|Additional Sync Days|
Disable Various Phone Sounds|Priority Discard Buttons|

Sign up for SugarSync Get 500MB extra space
Sign up for Dropbox Get 250MB extra space
mamouton is offline   Reply With Quote
Old 01/02/2010, 08:35 PM   #14 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

I fixed the email patch and updated the link in the first post.
samkim is offline   Reply With Quote
Thanked By: mamouton
Old 01/04/2010, 05:06 PM   #15 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

I've updated the patch to be much more efficient. It activates only for apps that are capable of switching between landscape and portrait.

I also fixed a bug related to interacting with one third-party app.
samkim is offline   Reply With Quote
Old 01/06/2010, 09:00 AM   #16 (permalink)
Member
 
Join Date: Jun 2007
Posts: 430
Likes Received: 3
Thanks: 4
Thanked 18 Times in 14 Posts
Default

i installed the new orientation patch but it still broke my messeging and email search.

i did not instally any of the landscape patches.

Can someone advice?
chrislo is offline   Reply With Quote
Old 01/06/2010, 10:07 AM   #17 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Sorry about that. With the previous update, I broke the email and messaging search again.

Please try it now. It should be working again. Thanks.
samkim is offline   Reply With Quote
Old 01/10/2010, 05:42 AM   #18 (permalink)
Member
 
Join Date: Jun 2007
Posts: 430
Likes Received: 3
Thanks: 4
Thanked 18 Times in 14 Posts
Default

this patch breaks you tube a little.

i do no have and do not intend to install you tube patch. but when keyboard is open. youtube becomes funny.
chrislo is offline   Reply With Quote
Old 01/10/2010, 11:22 PM   #19 (permalink)
Member
 
fritos1406's Avatar
 
Join Date: Jul 2009
Posts: 1,307
Likes Received: 1
Thanks: 34
Thanked 462 Times in 187 Posts
Default

yeahhh it happens to all videos even in the videos app
__________________

Donate Via Paypal to Email Adress: silent2205@gmail.com
Email: fritos1406@aim.com
Twitter: @fritos1406
fritos1406 is offline   Reply With Quote
Old 01/11/2010, 10:41 PM   #20 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Fixed. The patch now requires a manual initialization for all apps other than the browser and photos. Just don't initialize it for the Video app. Or for YouTube, if you don't have the YouTube landscape patch installed.
samkim is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0