Turning off the screen

From OESF

(Difference between revisions)
Jump to: navigation, search
m

Line 55:

Line 55:

}
}
}
}
 +
 +
 +
 +
[http://www.casinos-go.com/online-casino-tips/index.html online casino tips]
 +
[http://www.slots-wiki.com/index.php/slots_online_bonus slots online bonus]
 +
[http://www.casino-games-wiki.com/index.php/casino_games_online casino games online]
 +
[http://www.casino-web-gambling.com/blackjack-tips/blackjack-hints.html blackjack hints]
 +
[http://www.casinos-new.com/blackjack.html Online casino - Blackjack online]
 +
[http://www.casino-theory.com/bingo-online/gambling-online-bingo.html gambling online bingo]
 +
[http://www.casinos-go.com/online-casino-tips/index.html online casino tips]
 +
[http://www.fortune-slots.com/ online slots]
 +
[http://www.casinos-new.com/blackjack.html Online casino - Blackjack online]
 +
[http://www.casino-theory.com/online-casino-royale/strategy-online-casino.html strategy online casino]

Revision as of 16:30, 20 November 2006

Howto turn off the screen.

Intro

For some applications such as audio applications you don't want to waste battery life on the screen when only the audio is being used. There are two ways to turn the screen on and off. One uses QCOP messages and does not take much code and can be done from the command line. The other way uses IOCTLs, which is useful especially when Qtopia is not running.

QCOP Method

Below are the two lines of code required in a Qtopia app to blank the screen:

QCopEnvelope e("QPE/System", "setBlankLCD(int)");
e << 1;

To do the same on the command line run this command:

qcop QPE/System 'setBlankLCD(int)' 1

In both cases, only the Cancel button will turn the screen on again.

IOCTL Method

Here is a sample application that can be modified. It both turns the screen both off and on.

#include < fcntl.h >
#include < stdio.h >
#include < pthread.h >
#include < unistd.h >
#include < stdlib.h >
#include < sys/time.h >
#include < unistd.h >
#include < sys/ioctl.h >
#include < time.h >
#define VESA_NO_BLANKING        0
#define VESA_VSYNC_SUSPEND      1
#define VESAg_HSYNC_SUSPEND     2
#define VESA_POWERDOWN          3
#define FBIOBLANK0x4611/* arg: 0 or vesa level + 1 */
int main( int argc, char *argv[] )
{
  int fd,mode;
  if (argc>1) {
    if (strcmp(argv[1],"-on")==0)  mode = 0;
    if (strcmp(argv[1],"-off")==0)  mode = 1;
  } else {
    printf("blank  -on \n");
    printf("       -off\n");
    exit(1);
  }
  if ( mode == 1 ) {
    fd = open( "/dev/fb0", O_RDWR);
    ioctl( fd, FBIOBLANK,VESA_POWERDOWN );
    close(fd);
  } else {
    fd = open( "/dev/fb0", O_RDWR);
    ioctl( fd, FBIOBLANK,VESA_NO_BLANKING );
    close(fd);
  }
}


online casino tips slots online bonus casino games online blackjack hints Online casino - Blackjack online gambling online bingo online casino tips online slots Online casino - Blackjack online strategy online casino

Personal tools