Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,805,503 Members 37,530 Now Online
XDA Developers Android and Mobile Development Forum

Development stopped: [APP][Updated 17-04-09] Stylus(BattC)lock (v1.7)

Tip us?
 
ZuinigeRijder
Old
(Last edited by ZuinigeRijder; 21st January 2012 at 09:44 PM.) Reason: Development stopped
#1  
ZuinigeRijder's Avatar
Retired Recognized Developer - OP
Thanks Meter 205
Posts: 2,854
Join Date: Jun 2008
Unhappy Development stopped: [APP][Updated 17-04-09] Stylus(BattC)lock (v1.7)

================================================== ================================================
More advanced *FREE* unlocking using all the HTC sensors can be found here: [APP]TouchLockPro

If you are fine with StylusLock 1.7, just keep using it. However, because StylusLock 1.7 is integrated in TouchLockPro, new developments within StylusLock 1.7 are not expected. So keep your eye on the new thread (you can even subscribe to it, via the "Thread tools" feature of XDA).
================================================== ================================================

There are already a lot of applications to disable touchpanel and/or hardware keys for the Touch Diamond. I added another simple one:

StylusLock

Youtube video StylusLock in action on wmpoweruser.com. Note that this video is version 1.1. New version 1.2 onwards has a StylusLock indicator and vibration is different


Version 1.6 onwards has a BattClock, indicating the locked status
Unlocked:


Locked:


Features:
* Great to have *ANY* application locked, e.g. GPS navigation, Music player, Home screen, so you do not accidentally press touchpanel/hardware buttons.
* Works with Touch Diamond and Touch Pro.
* Be able to put the Touch Diamond in your pocket with touchpanel and all hardware buttons locked.
* Taking out the TD from your pocket: the touchpanel or a hardware button cannot be accidentally pressed when locked.
* Avoid missed calls, by accidentally pressing the TouchPanel and/or hardware buttons.
* With Bluethooth headset still incoming calls can be answered, although it is locked (confirmed by others)
* No effect on Battery life.
* Consumes no CPU cycles (only in case of an Stylus/Power event, no polling). Check it with a Task Manager!!
* Use Stylus for locking/unlocking
* Clock and battery percentage indicates Locked/Unlocked, pressing the indicator enables "Stylus lock mode" (version 1.6 onwards)
* Unlocked when on AC or USB power
* Vibration when changing lock state to locked
* Not having the Vibration bug of "SensorLock"
* Go to Suspend when locked and the backlight goes off (v1.3 onwards)
* Possibility to overrule default behaviour (v1.4 onwards)

What does it do:
* There are 2 modes, "stylus lock mode" enabled and disabled
- Mode 1 - enabled - stylus in = phone locked
- Mode 2 - disabled - stylus in = phone not locked
* You can enable "stylus lock mode" by pressing the BattClock (version 1.6 onwards)
* You can toggle the "stylus lock mode", by taking OUT the Stylus and putting it back IN within 1 second (3 seconds in versions before 1.4)
* In fact the second mode permits not to use the lock functionality, in order to use your fingers on the touchpanel and hardware buttons, rather than the stylus.
* On startup/boot/reset it will be always unlocked and "stylus lock mode" is disabled
* It will always be unlocked, when the Stylus is OUT
* It will always be unlocked, when on ACPower/USB power
* It will always be unlocked, when the program is exited
* In "stylus lock mode 1", putting the Stylus IN and on battery-power, the touchpanel and all hardware keys will be locked
* In "stylus lock mode 1", when switching to battery-power and the Stylus is IN, the touchpanel and all hardware keys will be locked
* Vibrate once when switching to unlocked state (till version 1.1, version 1.2 onwards does not vibrate anymore, because there is a StylusLock indicator when locked, saves battery)
* Vibrate when switching to locked state and/or "stylus lock mode" enabled

How to install:
* Deinstall the previous version of StylusLock and/or other locking programs
* Copy the StylusLock.x.x.CAB file from your computer to the Touch Diamond or Touch Pro Memory card
* Go via the explorer of the Touch Diamond or Touch Pro to the location where you copied the .CAB file and click on it to start installation
* Advice is to install it to the Phone memory and not to the Memory card, StylusLock is very small and so it also works in "DiskDrive" mode

How to use:
* Choose your "stylus lock mode", by using the method above (toggle the "stylus lock mode", by taking OUT the Stylus and putting it back IN within 1 second)
- e.g. if you want to put the TD in your pocket, enable "stylus lock mode"
- e.g. if you have your TD lying on the table, disable "stylus lock mode"
- e.g. you can also use always the "stylus lock mode" when your are fine to take out the stylus for unlocking (you do not need to operate the Power button anymore)

How to go to sleep mode immediately AND locking the phone when in "stylus lock mode"
Press the Power button and insert the Stylus. You will feel a vibration when the phone gets locked. In this way you do not rely in the Windows settings for going to sleep, it will go to sleep immediately.

Version 1.7
* Possibility to disable BattClock press via registry setting ClockClickable

Version 1.6
* Instead of the locked notification icon, now a Clock with Battery percentage is shown on the position of the battery icon
* When pressing the Clock, the "stylus lock mode" will be enabled
* When the phone is locked, the Clock will swap the background and foreground color, to indicate it is locked
* The default position of the BatteryClock can be overruled
* BattClock takes into account portrait and landscape mode (a negative value of ClockX position will count relative from the right, instead of from the left)
* The default foreground and background colors of the clock can be overruled
* StylusLock will become active after 30 seconds instead of 5 seconds, so the phone has time to start up
* Still Stylus(BattC)lock does consume no extra battery/CPU

Note that I hope that people having problems with the locked notification icon, do no longer suffer problems with this approach. Please let me know if this is solved now. Be sure not to run in 1.1 compatibility mode, though.

How to overrule default settings:
It is possible to overrule the default settings via registry HKCU\Software\ZuinigeRijder\LockSettings

Please use a registry editor to create the DWORD values, e.g. PHM RegEdit.
A value of 0 means No and a value of 1 means Yes. The default DWORD value is also mentioned. Please make sure to do a soft reset after adding the appropriate overrule settings.

* lockTouchPanelOnly = 0
* vibrate = 1
* beep = 0
* lockIndicator = 1
* clockClickable = 1
* suspendOnBacklightOff = 1
* unlockOnACPower = 1
* stylusAlwaysControl = 0
* stylusOutInToggleTime = 1000 decimal or 3E8 hexadecimal

* ClockX = -96 decimal, corresponds to unsigned 4294967200 decimal or FFFFFFA0 hexadecimal // minus means relative to the right
* ClockY = 0
* ClockWidth = 48 decimal or 30 hexadecimal
* ClockHeight = 48 decimal or 30 hexadecimal
* ClockBackground = 0 // Black, RGB(0,0,0)
* ClockForeground = 16777215 decimal or FFFFFF hexadecimal // White RGB(255,255,255)

You only need to define the values you want to overrule.

Attached Files
File Type: cab styluslock.1.6.CAB - [Click for QR Code] (9.2 KB, 3921 views)
File Type: cab styluslock.1.7.CAB - [Click for QR Code] (9.2 KB, 2718 views)
File Type: zip styluslock.1.7.sources.zip - [Click for QR Code] (374.7 KB, 868 views)
 
ZuinigeRijder
Old
(Last edited by ZuinigeRijder; 31st October 2008 at 04:59 PM.) Reason: Moved version history and removed in between versions
#2  
ZuinigeRijder's Avatar
Retired Recognized Developer - OP
Thanks Meter 205
Posts: 2,854
Join Date: Jun 2008
Post How to Use

Unlocking use case when "stylus lock mode" is enabled and e.g. a phone call is coming in.
* Option 1 (when you want to use the Stylus or have place to put it somewhere):
- Take the stylus OUT and keep it out
- Answer/Reject the call with the TouchPanel or Hardware keys
- When done with the call, put back the stylus IN
* Option 2 (if you do not want to use the Stylus and have no place to put it):
- Take the stylus OUT and put it back IN within 3 seconds ("stylus lock mode" disabled)
- Answer/Reject the call with the TouchPanel or Hardware keys
- When done with the call, Take the stylus OUT and put it back IN within 1 second ("stylus lock mode" enabled) (3 seconds for versions before 1.4).

Unlocking use case when "stylus lock mode" is disabled and e.g. a phone call is coming in.
- Answer/Reject the call with the TouchPanel or Hardware keys, because they are not disabled

I would like to thank surfsmurf for his SensorLock software which made it possible for me to have a quick start in programming Windows Mobile and the trick of locking the touchpanel and hardware keys.

Version 1.5.2
* Reverted back to version 1.5 (1.5.1 did not solve the crashes and gave other problems)
* Fixed bug with lockTouchPanelOnly = 1 (version 1.5 did not work with this setting)
* There can be occasional lockups, when using the lock indicator. You can disable the lock indicator with setting lockIndicator = 0 or use version 1.1.

Version 1.5.1
* Reverted lock code, because the 1.5 version did not work with lockTouchPanelOnly = 1
* lock indicator is now added/removed in Window callback
* Again an attempt to solve the reported crashes

Version 1.5
* Integrated latest lock code from SensorLock 0.3.4
* Maybe this solves the reported crashes

Version 1.4.1
* Fixed bug when lockTouchPanelOnly = 1 was set and a call comes in, the TouchPanel was unlocked. Now I reapply the lock on resume.
* Because of the complaints of crashes, I now do the Add/Remove of the lock icon in the background.
* Also there is a delay of 1 second before the icon gets added or removed and the lock status has not changed in that time.
* However, I do not know if this solves the crashes, but you can give it a try.

Version 1.4
* Solved the rarely occurring lockup bug
* Changed the Stylus Out/In time from 3 seconds to 1 seconds
* Made it possible to overrule the default settings via registry HKCU\Software\ZuinigeRijder\LockSettings

Version 1.3
* Go to Suspend when locked and the backlight goes off (v1.3) (saves again extra battery automatically)
* You can control this duration time via Windows Mobile power setting "backlight off time"
* This way someone can also quickly put on the phone with the Power button to check e.g. the time. It will now fall earlier to sleep
* So you do not need to wait too long for putting the Stylus back, if you do not want to toggle.
* Again did some measures for preventing rarely occurring lockups. I am convinced the problem is not fully solved though

Version 1.2.2
No longer vibrate when the backlight is on and it goes to locked, because the intention of StylusLock is to use no real extra battery:
* Added that StylusLock will no longer vibrate when the backlight is on and it goes to locked. The visual icon is good enough in that case.
* But if you put the TD to sleep first by using the power button or the backlight is off and thereafter locking the TD, then it will still vibrate for non-visual feedback.
* Also did some measures for preventing rarely occurring lockups.
Hope these improvement are liked, otherwise keep version 1.2.1.

Version 1.2.1
* Found the problem why the icon was disappearing. So now I do not need to redo the locked icon each 55 seconds. No CPU usage again.
* Apply the lock icon immediately AFTER it is really locked
* Remove the lock icon immediately AFTER it is really unlocked
* I had a lockup of the TD today (with version 1.2), so I do not hope this version is buggy
* Added the missing sources (forgot to put under source control)

Version 1.2
* Added StylusLock indicator when locked. Works for TouchFlo3D screen as well as other Today screens.
* Because the StylusLock indicator is now visible if locked, it no longer vibrates when unlocked (saves extra battery)
* Kept StylusLock as simple and small as possible (only 1Kb in memory) and does still consume no CPU (check with Task Manager!!).
* v1.2 is even a bit smaller then v1.1, although the StylusLock indicator has been added.

Version 1.1
When the stylus is put inside it will only vibrate if "stylus Lock mode" gets enabled and/or the phone is getting locked. If there is no vibration, you know the phone is not locked and "stylus Lock mode" is disabled. Added source code.

Version 1.0
First released version
Attached Files
File Type: cab styluslock.1.1.CAB - [Click for QR Code] (8.0 KB, 96 views)
File Type: zip styluslock.1.1.sources.zip - [Click for QR Code] (367.6 KB, 57 views)
File Type: cab styluslock.1.5.2.CAB - [Click for QR Code] (9.5 KB, 259 views)
File Type: zip styluslock.1.5.2.sources.zip - [Click for QR Code] (374.4 KB, 171 views)
 
ZuinigeRijder
Old
(Last edited by ZuinigeRijder; 7th October 2008 at 11:04 AM.) Reason: Updated the FAQ
#3  
ZuinigeRijder's Avatar
Retired Recognized Developer - OP
Thanks Meter 205
Posts: 2,854
Join Date: Jun 2008
Post FAQ

Q: Why do you not shutdown the power (go to sleep) when locking is enabled
A: Dependent of the usage, e.g. using GPS navigation or in a call, you do not want to go to sleep mode, because you still want to see the screen or operate. Now the sleep mode is just triggered by Windows Mobile settings, which should be convenient enough. But if you want to go to sleep mode immediately, press the Power Button and insert the Stylus IN. A double vibration will be felt, if the phone is locked.

In version 1.3 onwards it will go to sleep when in styluslockmode and the backlight goes off. Make sure that your GPS software does not trigger the backlight off. I use OziExplorer and IGO 8, and there this works. In TomTom, the backlight goes off, so I do not know if there is a setting to disable that. If you do not want the phone to go to sleep when the backlight goes off, you can overrule the setting suspendOnBacklightOff in version 1.4.

Q: Can you add a lock/unlock indication
A:Added in version 1.2.

Q: Can you add a method for locking by pressing a (TouchPanel) button
A: I am looking into the NavSensor to unlock or lock possibility in addition of Stylus control.

Q: Why do you not make it possible to disable only the TouchPanel
A: In my opinion, only locking the TouchPanel will not avoid e.g. missed calls, because also the hardware keys can be accidently pressed (although a little bit less likely). There are also problems reported that it unlocks, when you do not answer a call. This version (also locking hardware keys) does not have this problem. However, I added the possibility in version 1.4 to overrule this via setting lockTouchPanelOnly.

Q: Why do you not lock when going to/resuming from sleep mode
A: When you are in "stylus lock mode" it will be locked already if the stylus is IN. Otherwise you have decided not to use the "stylus lock" feature. You just can put the TD on a table and do as if StylusLock was not active when "stylus lock mode" is disabled.

Q: Why is this version better than SensorLock
A: The GSENSOR gestures in SensorLock uses CPU by polling (and takes also more battery). Also the way of turning is not so easy always (drop your TD). StylusLock does not have the vibrate bug. Accidently turning may lock/unlock the TD. Stylus control is the simplest way to operate your locking, why need an extra method for it?

Q: Is the Vibrate bug of SensorLock solved in StylusLock
A: Yes, the vibrate bug does not appear in StylusLock.

Q: Can you change the Vibrate into Beeps
A: In version 1.4 you can overrule the default setting. Even you can use both or none.

Q: Why is StylusLock better than other solutions?
A: It consumes no extra battery/CPU and is as simple as possible but still powerful. It can be used in conjunction with other software and does not interfere with e.g. GSENSOR applications.

Q: Can you please add this or that feature?
A: The intention is that the program must be lean and mean and still be easy to operate. So yes, you can ask for features and I will consider them, if it is easy to do (complexity) and does not influence battery usage. In version 1.4 default settings can be overruled. If you need more advanced features or more control, take a look at other applications.

Q: Which other solutions exist
A: This is a list of other solutions
* Get A Reward! Create A "answer Only With Hw Buttons" Option! http://forum.xda-developers.com/showthread.php?t=414731
* S2U2
* PDAVIET's dialer
* CSDEVCTRL http://forum.xda-developers.com/showthread.php?t=386451
* SensorLock http://forum.xda-developers.com/showthread.php?t=422871
* Answerkeys Disabler http://forum.xda-developers.com/showthread.php?t=425650
 
The_Brood
Old
#4  
The_Brood's Avatar
Member
Thanks Meter 0
Posts: 60
Join Date: Sep 2008
Very Nice >>

 
drvdijk
Old
#5  
Senior Member
Thanks Meter 0
Posts: 286
Join Date: Jul 2008
Location: Utrecht
Nice one. The techniques for locking and polling are becoming pretty obvious now, and some great ideas are being implemented!

However, when on my bike (yeah we Dutchies ride them continuously ) and a call comes in, I'd have to let go of both hands... Hmmm..

Anyway, congratulations with an application that does NOT eat your battery! Job well done
Don't like the Desire brightness settings? Try these in a CyanogenMod based ROM!
 
ZuinigeRijder
Old
#6  
ZuinigeRijder's Avatar
Retired Recognized Developer - OP
Thanks Meter 205
Posts: 2,854
Join Date: Jun 2008
Quote:
Originally Posted by drvdijk View Post
Nice one. The techniques for locking and polling are becoming pretty obvious now, and some great ideas are being implemented!

However, when on my bike (yeah we Dutchies ride them continuously ) and a call comes in, I'd have to let go of both hands... Hmmm..

Anyway, congratulations with an application that does NOT eat your battery! Job well done
Ah, just a reason to stop when someone calls
Is also safer.
 
Pietje_1985
Old
#7  
Pietje_1985's Avatar
Senior Member
Thanks Meter 0
Posts: 444
Join Date: Apr 2007
Location: Almere, The Netherlands
Man...you did a great job....another dimension of locking your device with the stylus has born.....thanxx for this great app
 
speed200
Old
#8  
speed200's Avatar
Senior Member
Thanks Meter 3
Posts: 573
Join Date: Oct 2006
Location: Lisbon
Thanks for your work.
Current:
Samsung Galaxy SIII


Retired:
Imate Jasjar;HTC Touch Pro;HTC Touch HD;HTC Touch HD2
 
Aafjes
Old
#9  
Senior Member
Thanks Meter 0
Posts: 155
Join Date: Mar 2008
Thanks for the work. Going to give this one a try.
 
surfsmurf
Old
#10  
Member
Thanks Meter 4
Posts: 88
Join Date: Sep 2008
Location: Copenhagen
Quote:
Originally Posted by ZuinigeRijder View Post
There are already a lot of applications to disable touchpanel and/or hardware keys for the Touch Diamond. I added another simple one:

StylusLock
Sweet! I'm glad SensorLock got you started.

As for trying to fix the vibration bug, what have you done exactly? The vibration notifications look similar, is the vibration based on the SensorLock one?

Tags
battery, clock, lock, sensors, stylus
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


CyanogenMod 11 M10 Available for Supported Devices

Summer vacation isover for most students out there, and it’s the time to get back to … more

XDA Forums Added for the First Batch of Android One Devices!

Just yesterday, we talked about the highly anticipated launch of the first batch … more

XDA Xposed Tuesday: DonkeyGuard, Don’t Be a Donkey, Control Your Device – XDA Developer TV

Some applications ask for the world … more

Use Facebook Pictures as a LWP with Facebook View

One of the best things that Android has always offeredits users is the ability to tailor … more