summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-18 22:00:20 (UTC)
committer zecke <zecke>2004-10-18 22:00:20 (UTC)
commitee87df9dcff32fe544e29b216edecaf2447c4a07 (patch) (unidiff)
treea40d33e0c9cdf29a050a68d4b053c121bc982dfc
parentb4a613303322cd557915baa621d4a1cef749af59 (diff)
downloadopie-ee87df9dcff32fe544e29b216edecaf2447c4a07.zip
opie-ee87df9dcff32fe544e29b216edecaf2447c4a07.tar.gz
opie-ee87df9dcff32fe544e29b216edecaf2447c4a07.tar.bz2
Bug #0001427 add microkbd Opie.Sh script to control activation
and deactivation of the microkbd See http://www.handhelds.org/handhelds-faq/keyboards.html to understand telinit and opening of the file Files courtsey "Iss"
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--apps/Opie-SH/microkbd.desktop20
-rwxr-xr-xnoncore/tools/opie-sh/scripts/microkbd.sh87
-rw-r--r--pics/opie-sh-scripts/kbdctrl.pngbin0 -> 149 bytes
-rw-r--r--pics/opie-sh-scripts/keyz-cfg.pngbin0 -> 2761 bytes
4 files changed, 107 insertions, 0 deletions
diff --git a/apps/Opie-SH/microkbd.desktop b/apps/Opie-SH/microkbd.desktop
new file mode 100644
index 0000000..78e20f0
--- a/dev/null
+++ b/apps/Opie-SH/microkbd.desktop
@@ -0,0 +1,20 @@
1[Desktop Entry]
2Exec=microkbd.sh
3Icon=opie-sh-scripts/keyz-cfg
4Type=Application
5Name=Keyboard Control
6Comment=Start/Stop Keyboard
7Name[es]=Control MicroKbd
8Comment[es]=Activa/desactiva teclado MicroKbd
9Name[fr]=Control MicroKbd
10Comment[fr]=Gestion du clavier MicroKbd
11Name[it]=Controllo MicroKbd
12Comment[it]=Attiva/disattiva tastiera MicroKbd
13Name[pt]=Teclado MicroKbd
14Comment[pt]=Gestor teclado MicroKbd
15Name[pt_BR]=Teclado MicroKbd
16Comment[pt_BR]=Gerenciador teclado MicroKbd
17Name[sl]=MicroKbd kontrole
18Comment[sl]=MicroKbd kontrole za tipkovnico
19Name[nl]=MicroKbd Controle
20Comment[nl]=Activeer MicroKbd toetsenborden
diff --git a/noncore/tools/opie-sh/scripts/microkbd.sh b/noncore/tools/opie-sh/scripts/microkbd.sh
new file mode 100755
index 0000000..d602ea5
--- a/dev/null
+++ b/noncore/tools/opie-sh/scripts/microkbd.sh
@@ -0,0 +1,87 @@
1#!/bin/sh
2
3#stowctrl.sh - modified usbnetctrl.sh from gonz by spiralman spiralman@softhome.net
4# usbnetctrl.sh - a demonstration of opie-sh
5#
6# Copyright (C) 2002 gonz@directbox.com
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# 20020524-1 - code beautification, added icons and reset
19# 20020517-2 - bugfixed fullscreen, added info about ifconfig
20# 20020517-1 - added about, fullscreen and icon
21
22OPIE_SH=$OPIEDIR/bin/opie-sh
23
24######################################################################
25# subroutines
26
27about() {
28 ( echo "<img src=opie-sh-scripts/kbdctrl>"
29 echo "<h3>About</h3>"
30 echo "This little App should make it easy for you to "
31 echo "activate / deactivate the micro keyboard (on ipaq)"
32 echo "<p>"
33 ) | $OPIE_SH -t "microkbd control" -f &
34 SCREENCLEAN=$!
35 sleep 1
36}
37
38startup() {
39 echo "<img src=opie-sh-scripts/kbdctrl>" > /tmp/sout
40 echo "<h3>keyboard up</h3>" >> /tmp/sout
41 telinit 4
42 modprobe h3600_microkbd >> /tmp/sout
43 cat /dev/microkbd/iconcepts &
44 echo $! > /tmp/kbdcatpid
45 $OPIE_SH -t Output -f /tmp/sout
46 rm /tmp/sout
47 qcop QPE/System 'suspend()'
48}
49
50stopit() {
51 ( echo "<img src=opie-sh-scripts/kbdctrl>"
52 echo "<h3>keyboard down</h3>"
53 read THECAT < /tmp/kbdcatpid
54 kill $THECAT
55 rmmod h3600_microkbd
56 telinit 2
57 ) 2>&1 | $OPIE_SH -t Output -f
58}
59
60
61cleanup() {
62 kill $SCREENCLEAN
63 rm -f /tmp/qcop-msg-microkbd.sh
64}
65
66
67yesorno() {
68 $OPIE_SH -m -t "MicroKbd Up/Down" -M "What to do with the Micro Keyboard: " \
69 -g -0 Up -1 Down -2 Restart
70 RETURNCODE=$?
71
72 case $RETURNCODE in
73 -1) echo error...
74 cleanup
75 exit ;;
76 0) startup ;;
77 1) stopit ;;
78 2) stopit ; sleep 1 ; startup ;;
79 esac
80}
81
82######################################################################
83# main
84
85about
86yesorno
87cleanup
diff --git a/pics/opie-sh-scripts/kbdctrl.png b/pics/opie-sh-scripts/kbdctrl.png
new file mode 100644
index 0000000..6200ce1
--- a/dev/null
+++ b/pics/opie-sh-scripts/kbdctrl.png
Binary files differ
diff --git a/pics/opie-sh-scripts/keyz-cfg.png b/pics/opie-sh-scripts/keyz-cfg.png
new file mode 100644
index 0000000..2855f5f
--- a/dev/null
+++ b/pics/opie-sh-scripts/keyz-cfg.png
Binary files differ