It is currently May 3rd, 2024, 12:02 pm

Lock Screen

Get help with creating, editing & fixing problems with skins
Ricoow
Posts: 12
Joined: November 19th, 2012, 3:50 pm

Lock Screen

Post by Ricoow »

Hello Guys

I was experimenting with the Project Erebus screen, already created some new things but now I need a lock screen. That is already done but I want a nice way to unlock it (and the people at my home won't guess :P). A button is so easy to understand when unlocking
I want to unlock it having my mouse pressed and pressing my right afterwards
Like this:
MiddleMouseDownAction -> RightMouseDownAction -> Deactivate

I was thinking of a way with:
MiddleMouseDownAction=[!SetVariable Lock "1"]
MiddleMouseUpAction=[!SetVariable Lock "0"]
RightMouseDownAction=<Check if Lock = 1, then do !RainmeterDeactivate...

but I don't know how If-statements work here and what to insert at the RightMouseDown
Anybody has some tips?
If this isn't possible, is it possible to do:
MiddleMouseDownAction -> Button -> RightMouseDown -> Deactivate

And is it possible to lock the keyboard from being used untill the lock screen Config is stopped?

I would be pleased if anybody could help me :)
Thanks in Advance,
Ricoow
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Lock Screen

Post by MerlinTheRed »

Rainmeter in itself is not able to lock your screen, nor do I think your screen is actually locked when you are still able to interact with a Rainmeter skin. Additionally, clicking two mouse buttons is about the most insecure way I can think of to unlock your screen.

If you really just want some cool looking interface that looks like your screen is locked, although it is really not, you might accomplish this mouse click behavior by multiplying the value of the "Middle mouse is clicked" variable with the variable you set when the screen should be unlocked. If the middle mouse button is not clicked, the value will be 0, which means clicking the right mouse button will do nothing because the value it should set is multiplied by 0. When you have your middle mouse clicked, you set the variable to 1, meaning that the right mouse click will take effect because its value is now multiplied by 1.

The only thing you have to take care of is implementing the locking of your screen in some other way. Otherwise your screen will be locked whenever you click your right mouse button on that specific area.

I hope this wall of text makes some sense to you...
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Ricoow
Posts: 12
Joined: November 19th, 2012, 3:50 pm

Re: Lock Screen

Post by Ricoow »

I was already that far and I know its a fake lock screen, at least I have got the Windows Taskbar covered :)
I only don't know how I can link the RightMouseDownAction with an if-statement.
And what I just added as code for the first mouse button didn't even work. My 'debug' variable kept showing 0.

Edit:

Code: Select all

[Back]
Meter=IMAGE
DynamicVariables=1
X=0
Y=0
H=#WorkAreaHeight#
W=#WorkAreaWidth#
SolidColor=0,0,0,215
LeftMouseDownAction=!SetVariable Number (#Number+1)


[dbgNumber]
Meter=STRING
Y=200
X=(#WorkAreaWidth#-800)
H=8
W=8
FontFace=Agency FB
FontSize=5
StringAlign=Right
FontColor=255,255,255,240
SolidColor=100,100,100,100
StringStyle=Bold
StringCase=Upper
Text=#Number#
This doesn't change my Variable Number...
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Lock Screen

Post by MerlinTheRed »

Code: Select all

[Variables]
LeftClicked=0
Locked=1

[Back]
Meter=IMAGE
DynamicVariables=1
X=0
Y=0
H=#WorkAreaHeight#
W=#WorkAreaWidth#
SolidColor=0,0,0,215
LeftMouseDownAction=!SetVariable #LeftClicked# 1
LeftMouseUpAction=!SetVariable #LeftClicked# 0
RightMouseDownAction=!SetVariable #Locked# "(#Locked# > 0 ? #Locked#-#LeftClicked# : 0)"

[dbgNumber]
Meter=STRING
Y=200
X=(#WorkAreaWidth#-800)
H=8
W=8
FontFace=Agency FB
FontSize=5
StringAlign=Right
FontColor=255,255,255,240
SolidColor=100,100,100,100
StringStyle=Bold
StringCase=Upper
Text=#Locked#
Hold your left mouse button and click the right one to set #Locked# to 0.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Lock Screen

Post by eclectic-tech »

Merlin's suggestion will work...

The reason your variable did not change on your code is because a '#' is missing from the LeftMouseDown action variable name...

You had:LeftMouseDownAction=!SetVariable Number (#Number+1)
Correct: LeftMouseDownAction=!SetVariable Number (#Number[b]#[/b]+1)

I find myself doing that all the time! ;-)
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Lock Screen

Post by MerlinTheRed »

Use an editor with proper Rainmeter syntax highlighting and you will never have this problem again.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lock Screen

Post by jsmorley »

MerlinTheRed wrote:Use an editor with proper Rainmeter syntax highlighting and you will never have this problem again.
Shameless plug... ;-)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Lock Screen

Post by eclectic-tech »

jsmorley wrote: Shameless plug... ;-)
So True! And after just getting his Sublime thread added to the sticky section! :oops:

You have done a great job on the rainmeter package for the sublime2 editor Merlin!
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Lock Screen

Post by MerlinTheRed »

I didn't say specifically which editor to use ;) RainLexer with Notepad++ might be better suited for some people.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!