Help backlight

Mazacote

Member
Licensed User
Longtime User
Hello.
I need to turn off the back light screen, but harware.dll only have a BackLightOn and BackLightNormal.
I need a "BackLightOff". Can someone do like this?
Tanks.
:sign0013:for my bad enghlish.
 

JJM

Active Member
Licensed User
Longtime User
Hi,

you use Backlightnormal and your PPC w'll light off the screen after 30' or more.
You must configure your PPC to light off screen only or PPC if it's on battery or on main.

Bye
JJ M
 

Mazacote

Member
Licensed User
Longtime User
Hi,

you use Backlightnormal and your PPC w'll light off the screen after 30' or more.
You must configure your PPC to light off screen only or PPC if it's on battery or on main.

Bye
JJ M

It already I know it. But I want to turn off the light on having touched a button for example.
I have a Mio P350 and when I disconnect the screen with "screentoggle" to save battery with tomtom 6, there is disconnected also the GPS (this did not happen with my previous one N35). Because of it I want to do an application that disconnects only the light and not the screen also. Tomtom annuls the function of disconnected in 30 seconds.
 

Mazacote

Member
Licensed User
Longtime User
Also you can press and hold power button:)

That was first that I did. That does not work in this pda. Anyway, also to my it interests to me to disconnect the light for future programs.

Summary: I want an order that commands to disconnect the light.

I do not know if you understand well my english. Thanks.
 

Cableguy

Expert
Licensed User
Longtime User
Hi,

In fact your English is a bit confusing....

You You wish to turn off the backlight using B4ppc, then I think you are out of luck for now since there is no method, command or DLL that supoorts it...So for now you're stuck....
 

BjornF

Active Member
Licensed User
Longtime User
Actually I think it can be done, by using the shell command together with Mortscript... :)

See: http://www.sto-helit.de
(There seems to be some restrictions on the function though, I'm not sure if they apply in your case)

Mortscript is a freeware script program which has a lot of good possibilities - and even more when you combine it with Basic4ppc ! (and no, I am not the author of it, though I wish I was ;))

1 You would need to install Mortscript,
2. Write a textfile with the content: Setbacklight(0,0)
3. Name it e.g. backlight.msi
4. Run Shell("backlight.msi","")

all the best and good luck / Bjorn
 
Last edited:

schimanski

Well-Known Member
Licensed User
Longtime User
Hello Mazacote!

You can set the screen off with the PowerNotify-dll (PowerNotify.ScreenOff). This command is able to set only the screen off, nothing else. The problem is, when you turn on the screen. Some devices disconnect the gps-connection, when the power-hardwarebutton is pressed. So you have a gps-connection for the time, when the screen is off, but with pressing the on/off-hardwarebutton to turn the screen on, the gps will be disconnected.

On some devices you can't set the screen on with the hardware-powerbutton. You have to use the hardware.lib with hardware.ScreenOn. (You can use it with a keypressed-event).

But the sreenon-function doesn't work on every devices. On some devices you can start a mortscript-app (toggleOn), when hardware.ScreenOn sets an error. But i dont' know a way, that runs on every devices.

Here one example to set the screen on and off:

B4X:
'Screen Off'
Sub Menu7_Click
   ErrorLabel(ScreenOff_error)
   
   PowerNotify.ScreenOff
   Return
   
   ScreenOff_error:
   Msgbox("Device not able to set the screen off!")
End Sub

'Screen on'
Sub HardKeys_HardKeyPressed
   ErrorLabel(ScreenOn_error)
   
   If HardKeys.KeyPressed=HardKeys.KeyEnter Then
      hardware.ScreenOn
   End If
   Return
   
   ScreenOn_error:
   'here you can start a mortscript-app to set the screen on'
End Sub

regards from germany...
 
Top