You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1046 lines
32 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/sh
# Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands
# Copyright 2015-2017 Thorn Inurcide
# Copyright 2015-2017 tde-slackbuilds project on GitHub
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
# any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all
# copies.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
PRGNAM=kvkbd
VERSION=$TDEVERSION
BUILD=${BUILD:-1}
TAG=${TAG:-_tde}
source ../../get-source.sh
getsource_fn
untar_fn
# ### 2021-02-12
## These changes are being merged piecemeal to git resulting in patches, and the build, failing.
## This script will be updated when all merges have been completed, but meanwhile, to build kvkbd with these patches, revert the repo to compatible revisions
[[ $TDEVERSION != 14.0.9 ]] && {
(cd $BUILD_TDE_ROOT/src/cgit/$PRGNAM/
git reset HEAD *
rm -rf .git/worktrees/*
## don't need info about 'detached HEAD' state - only using the repo as a build source
git config advice.detachedHead false
[[ $TDEVERSION == 14.1.0 ]] && git checkout -f 2a5540d || git checkout -f 2882ff6
## overwrite the files in the build area set up by untar_fn with the source now in 'detached HEAD' state ..
echo -e "\n copying $PRGNAM 'detached HEAD' state sources to build area ... \n"
(cd $BUILD_TDE_ROOT/src/cgit
cp -a --parents $PRGNAM/* $TMP_BUILD/tmp-$PRGNAM/
cp -a --parents cmake/* $TMP_BUILD/tmp-$PRGNAM/$PRGNAM/)
## and then switch back to master branch ready for the next pull ..
echo -e "\n ### Switching cgit source to master branch ### \n"
git checkout master
echo
)
}
# ###
## copy the helpfile docs to the build tree
cp -a $SRCDIR/doc .
cp $SRCDIR/dock.png src/
## copy translations
cp $SRCDIR/translations/messages/* translations/messages/
## not in this version - introduced for the later qt4 build
sed -i '/CSS Color themes/d' README
## remove meinproc check - there are a number of validity errors relating to the use of <sbr/> etc.,
## which I feel provides a better presentation. The help file displays as intended.
sed -i 's|--check --cache index.cache.bz2|--cache index.cache.bz2|' cmake/modules/TDEMacros.cmake
## These patches are applied in chunks to identify the changes being made and allow any particular change to be easily identified and removed if required
## Add a key, LSGT, between 'left shift' and 'z' for non-US keyboards.
## This duplicates '<' and '>' characters for US keyboards, but otherwise leaves the US keyboard fully functional.
## The key which is normally lower left of Enter on non-US keyboards is above the Enter key.
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
#
## add a key[code] to row 4
@@ -46 +46 @@
-#define R4LEN 7
+#define R4LEN 8
#
## add keycode 94 key between l-shift and z key
## gb=\| fr=<> de=<>| [us=<>] etc
@@ -72,3 +72,3 @@
- //TQString k4="zxcvbnm"; //,./";
- //TQString k4s="ZXCVBNM";
- unsigned int kc4[R4LEN] = {52,53,54,55,56,57,58};//59,60,61};
+ //TQString k4="<zxcvbnm"; //,./";
+ //TQString k4s=">ZXCVBNM";
+ unsigned int kc4[R4LEN] = {94,52,53,54,55,56,57,58};//59,60,61};
#
## reduce width of left shift key
@@ -249 +249 @@
- lshft->resize ( 80,30 );
+ lshft->resize ( 45,30 );
#
## remove one key space after left shift
## and fix spacing
@@ -262 +262 @@
- v->move ( stx+35+16+35+ ( 35*a ),sty+ ( 4*35 ) );
+ v->move ( stx+lshft->width() +5+ ( 35*a ),sty+ ( 4*35 ) );
EOF
## Add RWin button
patch -N -p0 << EOF || true
## new button added
--- src/MainWidget.h
+++ src/MainWidget.h
@@ -96,2 +96,3 @@
VButton *win;
+ VButton *rwin;
VButton *mnu;
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
#
## RWin 'locks' with mouse click
@@ -353,2 +354,11 @@
+ rwin = new VButton ( this,"" );
+ rwin->resize ( 50,30 );
+ rwin->move ( ralt->x() +ralt->width() +5, sty+ ( 5*35 ) );
+ rwin->setText ( "RWin" );
+ rwin->setKeyCode ( 134 );
+ rwin->setToggleButton ( true );
+ mod_keys.append( rwin );
+ rwin->res();
+
#
## Menu now follows RWin not Alt Gr
@@ -355,4 +364,4 @@
mnu = new VButton ( this,"" );
- mnu->resize ( 45,30 );
- mnu->move ( 5+ralt->x() +ralt->width(), sty+ ( 5*35 ) );
+ mnu->resize ( 50,30 );
+ mnu->move ( rwin->x() +rwin->width() +5, sty+ ( 5*35 ) );
mnu->setText ( "Menu" );
EOF
## Fix keycodes for evdev mapping:
## Right shift, LWin, AltGr, Menu, Right Ctrl, Num pad divide, Num pad Enter
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -296 +296 @@
- rshft->setKeyCode ( 50 );
+ rshft->setKeyCode ( 62 );
@@ -321 +321 @@
- win->setKeyCode ( 115 );
+ win->setKeyCode ( 133 );
@@ -349 +349 @@
- ralt->setKeyCode ( 113 );
+ ralt->setKeyCode ( 108 );
@@ -368 +368 @@
- mnu->setKeyCode ( 117 );
+ mnu->setKeyCode ( 135 );
@@ -379 +379 @@
- rctrl->setKeyCode ( 37 );
+ rctrl->setKeyCode ( 105 );
@@ -468 +468 @@
- div->setKeyCode(112);
+ div->setKeyCode(106);
@@ -485 +485 @@
- ent->setKeyCode(36);
+ ent->setKeyCode(104);
EOF
## Cosmetic changes:
## Set F4-F5 spacing as per F8-F9
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -97 +97 @@
- f->move ( stx+esc->width() + ( 35*a ) +20,sty );
+ f->move ( stx+esc->width() +30 + ( 35*a ),sty );
@@ -107 +107 @@
- f->move ( stx+esc->width() + ( 35*a ) +40+ ( 4*35 ),sty );
+ f->move ( stx+esc->width() +30 + ( 4*35 ) +14 + ( 35*a ),sty );
@@ -118 +118 @@
- f->move ( stx+esc->width() + ( 35*a ) +45+ ( 8*35 ) +10,sty );
+ f->move ( stx+esc->width() +30 + ( 8*35 ) +28 + ( 35*a ),sty );
#
## resize keys for alignment on right side of keyboard
@@ -139 +139 @@
- bksp->resize ( 46,30 );
+ bksp->resize ( 48,30 );
@@ -149 +149 @@
- tab->resize ( 47,30 );
+ tab->resize ( 48,30 );
## reduce size of Dock image
@@ -938 +938 @@
- resize ( 96,47 );
+ resize ( 64,31 );
EOF
## Revise positions of keys and reformat code to represent the calculations left-to-right
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -219,3 +219,3 @@
smcl->setKeyCode ( 47 );
- smcl->move ( stx+ ( R3LEN *35 ) +caps->width() +5,sty+ ( 3*35 ) );
+ smcl->move ( stx+caps->width() +5+ ( R3LEN *35 ) ,sty+ ( 3*35 ) );
//smcl->setText ( ";" );
@@ -228,3 +228,3 @@
sngq->setKeyCode ( 48 );
- sngq->move ( stx+ ( ( R3LEN +1 ) *35 ) +caps->width() +5,sty+ ( 3*35 ) );
+ sngq->move ( stx+caps->width() +5+ ( ( R3LEN +1 ) *35 ) ,sty+ ( 3*35 ) );
//sngq->setText ( "'" );
@@ -237,3 +237,3 @@
enter->setKeyCode ( 36 );
- enter->move ( stx+ ( ( R3LEN +2 ) *35 ) +caps->width() +5,sty+ ( 3*35 ) );
+ enter->move ( stx+caps->width() +5+ ( ( R3LEN +2 ) *35 ) ,sty+ ( 3*35 ) );
enter->resize ( 50,30 );
@@ -269,3 +269,3 @@
sm->setKeyCode ( 59 );
- sm->move ( stx+ ( R4LEN *35 ) +lshft->width() +5,sty+ ( 4*35 ) );
+ sm->move ( stx+lshft->width() +5+ ( R4LEN *35 ) ,sty+ ( 4*35 ) );
//sm->setText ( "," );
@@ -278,3 +278,3 @@
gr->setKeyCode ( 60 );
- gr->move ( stx+ ( ( R4LEN +1 ) *35 ) +lshft->width() +5,sty+ ( 4*35 ) );
+ gr->move ( stx+lshft->width() +5+ ( ( R4LEN +1 ) *35 ) ,sty+ ( 4*35 ) );
//gr->setText ( "." );
@@ -287,3 +287,3 @@
sl->setKeyCode ( 61 );
- sl->move ( stx+ ( ( R4LEN +2 ) *35 ) +lshft->width() +5,sty+ ( 4*35 ) );
+ sl->move ( stx+lshft->width() +5+ ( ( R4LEN +2 ) *35 ) ,sty+ ( 4*35 ) );
//sl->setText ( "/" );
@@ -296,3 +296,3 @@
rshft->setKeyCode ( 62 );
- rshft->move ( stx+ ( ( R4LEN +3 ) *35 ) +lshft->width() +5,sty+ ( 4*35 ) );
+ rshft->move ( stx+lshft->width() +5+ ( ( R4LEN +3 ) *35 ) ,sty+ ( 4*35 ) );
rshft->resize ( 68,30 );
@@ -305,3 +305,3 @@
-
+ //ROW 5
lctrl = new VButton ( this,"" );
@@ -317,5 +317,5 @@
win = new VButton ( this,"" );
- win->resize ( 45,30 );
- win->move ( 5+lctrl->x() +lctrl->width(), sty+ ( 5*35 ) );
- win->setText ( "Win" );
+ win->resize ( 50,30 );
+ win->move ( lctrl->x() +lctrl->width() +5, sty+ ( 5*35 ) );
+ win->setText ( "LWin" );
win->setKeyCode ( 133 );
@@ -328,3 +328,3 @@
lalt->resize ( 45,30 );
- lalt->move ( 5+win->x() +win->width(), sty+ ( 5*35 ) );
+ lalt->move ( win->x() +win->width() +5, sty+ ( 5*35 ) );
lalt->setText ( "Alt" );
@@ -338,4 +338,4 @@
space->setKeyCode ( 65 );
- space->resize ( 5*35+28,30 );
- space->move ( 5+lalt->x() +lalt->width(),sty+ ( 5*35 ) );
+ space->resize ( 133,30 );
+ space->move ( lalt->x() +lalt->width() +5, sty+ ( 5*35 ) );
connect ( space, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) );
@@ -345,4 +345,4 @@
ralt = new VButton ( this,"" );
- ralt->resize ( 45,30 );
- ralt->move ( 5+space->x() +space->width(), sty+ ( 5*35 ) );
+ ralt->resize ( 50,30 );
+ ralt->move ( space->x() +space->width() +5, sty+ ( 5*35 ) );
ralt->setText ( "AltGr" );
@@ -376,3 +376,3 @@
rctrl->resize ( 45,30 );
- rctrl->move ( 5+mnu->x() +mnu->width(), sty+ ( 5*35 ) );
+ rctrl->move ( mnu->x() +mnu->width() +5, sty+ ( 5*35 ) );
rctrl->setText ( "Ctrl" );
EOF
## Replace text on Num pad keys for a better fit
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -411 +411 @@
- TQString txt[9] = { "Ho\nme", TQString::fromUtf8("▲"), "Pg\nUp",
+ TQString txt[9] = { TQString::fromUtf8("H\u2190"), TQString::fromUtf8("▲"), TQString::fromUtf8("P\u2191"),
@@ -413 +413 @@
- "End", TQString::fromUtf8("▼"), "Pg\nDn" };
+ TQString::fromUtf8("E\u2192"), TQString::fromUtf8("▼"), TQString::fromUtf8("P\u2193") };
@@ -457 +457 @@
- numl->setText("Num\nLock");
+ numl->setText(TQString::fromUtf8("\u2116"));
EOF
## dead_* characters don't display on keys, so add single click printable character equivalents
## to display on keys - the printed character remains as dead_<whatever>
## Only needed for levels 0 and 1 - higher levels don't show on keys
## NoSymbol shows as an outline square [.notdef] on keys - replace with space=blank
## Re: MainWidget.cpp "* therefore keysymtab[] must remain SORTED by keysym value."
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -1008,2 +1030,3 @@
} keysymtab[] = {
+ { 0x0000, 0x0020 }, /* NoSymbol -> <- space */
{ 0x01a1, 0x0104 }, /* Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */
@@ -1781,2 +1782,18 @@
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
+ { 0xfe50, 0x0060 }, /* dead_grave \` */
+ { 0xfe51, 0x00b4 }, /* dead_acute ´ */
+ { 0xfe52, 0x02c6 }, /* dead_circumflex ˆ */
+ { 0xfe53, 0x02dc }, /* dead_tilde ˜ small tilde */
+ { 0xfe54, 0x00af }, /* dead_macron ¯ */
+ { 0xfe55, 0x02d8 }, /* dead_breve ˘ */
+ { 0xfe56, 0x02d9 }, /* dead_abovedot ˙ */
+ { 0xfe57, 0x00a8 }, /* dead_diaeresis ¨ */
+ { 0xfe58, 0x02da }, /* dead_abovering ° */
+ { 0xfe59, 0x02dd }, /* dead_doubleacute ˝ */
+ { 0xfe5a, 0x02c7 }, /* dead_caron ˇ */
+ { 0xfe5b, 0x00b8 }, /* dead_cedilla ¸ */
+ { 0xfe5c, 0x02db }, /* dead_ogonek ˛ */
+ { 0xfe5d, 0x0269 }, /* dead_iota ɩ Latin small iota */
+ { 0xfe64, 0x1fbf }, /* dead_abovecomma Greek Psili */
+ { 0xfe65, 0x1ffe }, /* dead_abovereversedcomma Greek Dasia */
};
EOF
## add a tooltip for the panel icon
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -1834,3 +1834,3 @@
{
-
+ TQToolTip::add ( this, "Virtual keyboard" );
}
EOF
## Fix Num pad numbers where 0-9 aren't the non-shift characters on the keyboard
## E.g. for fr, the num pad '1' [KP_1 keycode 87] appears as '&' [keycode 10] when Num Lock is on
## And fix Del keycode so that KP_Separator prints correctly, eg for gr = comma
## This is a quick-and-dirty fix because it effectively means that this routine is redundant.
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -416 +416 @@
- int nval[9] = {16,17,18,13,14,15,10,11,12};
+ int nval[9] = {79,80,81,83,84,85,87,88,89};
@@ -436 +436 @@
- ins->setKeyCode(19,90);
+ ins->setKeyCode(90,90);
@@ -448 +448 @@
- del->setKeyCode(60,91);
+ del->setKeyCode(91,91);
EOF
## kvkbd --background <color> doesn't work, so
## set a default keyboard background colour
## Changeable from configuration menu
#
## for the plastik and keramik styles which have a key boundary within the key 30x30 footprint,
## setting the button/key background colour will bleed through outside that boundary
## except for the configuration button and the num pad keys, which follow these two lines.
## Moving these settings to the beginning of MainWidget::MainWidget enables all keys to be displayed correctly.
#
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -79,2 +79,5 @@
+ setPaletteBackgroundColor ( TQColor("#cdc0b0") );
+ setFocusPolicy ( TQ_NoFocus );
+
// resize ( 550,235 );
@@ -405,5 +408,2 @@
- setPaletteBackgroundColor ( TQt::black );
- setFocusPolicy ( TQ_NoFocus );
-
EOF
## use icons for quit and num pad show/hide buttons
## these are the 16x16/actions icons used for the system selected icon set
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
#
## num pad show button
@@ -400 +400 @@
- extent->setText(">>");
+ extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
@@ -698 +698 @@
- extent->setText(">>");
+ extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
#
## num pad hide button
@@ -702 +702 @@
- extent->setText("<<");
+ extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward")).pixmap());
#
## quit button
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -392 +392 @@
- quit->setPaletteBackgroundColor ( TQt::red );
+ quit->setPixmap(TQIconSet(SmallIcon("application-exit")).pixmap());
EOF
## Display '&' where it is the lower key character on the key
## E.g. fr be azerty keyboards
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -895,5 +897,9 @@
TQString btn_text(TQChar((uint)ret));
- v.setText(btn_text);
+ TQChar c((uint)ret);
+ if (c=='&')
+ v.setText("&&");
+ else
+ v.setText(btn_text);
TQString btn_upper(btn_text.upper());
EOF
## resize quit, num pad show/hide, configure buttons to see the icons better at reduced size of keyboard
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -390,2 +390,2 @@
- quit->resize ( 15,30 );
- quit->move ( 525,15 );
+ quit->resize ( 20,30 );
+ quit->move ( 526,15 );
@@ -398,2 +398,2 @@
- extent->resize( 15,65 );
- extent->move(525, 85 );
+ extent->resize ( 20,65 );
+ extent->move(526, 85 );
@@ -551,2 +551,2 @@
- popup_menu->resize ( 15,30 );
- popup_menu->move ( 525,15+35 );
+ popup_menu->resize ( 20,30 );
+ popup_menu->move ( 526,15+35 );
#
## move numpad after resizing buttons
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -410 +410 @@
- int padx= 550;
+ int padx= 554;
#
## move and resize keyboard
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -593 +593 @@
- int d_width=550;
+ int d_width=553;
@@ -639,2 +639,2 @@
- sdxs = width() - (width() * (150.0/700.0));
- VButton::pw=700.0;
+ sdxs = width() - (width() * (150.0/703.0));
+ VButton::pw=703.0;
@@ -642 +642 @@
- setMinimumSize(700/3,235/3);
+ setMinimumSize(703/3,235/3);
@@ -646,2 +646,2 @@
- sdxb = width() + (width() * (150.0/550.0));
- VButton::pw=550.0;
+ sdxb = width() + (width() * (150.0/552.0));
+ VButton::pw=552.0;
@@ -649 +649 @@
- setMinimumSize(550/3,235/3);
+ setMinimumSize(552/3,235/3);
--- src/VButton.cpp
+++ src/VButton.cpp
@@ -5 +5 @@
-double VButton::pw=550.0;
+double VButton::pw=552.0;
EOF
## missing characters in keysymtab[] - for AC12 -> AD13 key on ua keyboard
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -1251,2 +1251,3 @@
{ 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */
+ { 0x06ad, 0x0491 }, /* Ukrainian_ghe_with_upturn ґ CYRILLIC SMALL LETTER GHE WITH UPTURN */
{ 0x06ae, 0x045e }, /* Byelorussian_shortu ў CYRILLIC SMALL LETTER SHORT U */
@@ -1266,2 +1267,3 @@
{ 0x06bc, 0x040c }, /* Macedonia_KJE Ќ CYRILLIC CAPITAL LETTER KJE */
+ { 0x06bd, 0x0490 }, /* Ukrainian_GHE_WITH_UPTURN Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN */
{ 0x06be, 0x040e }, /* Byelorussian_SHORTU Ў CYRILLIC CAPITAL LETTER SHORT U */
EOF
## generate keycode for Win keys with single click so that they can be used for xmodmap
## User option, set in ./BUILD-TDE.sh
[[ $WinLock != 1 ]] && {
echo -e "\033[36;1m"'patching for Win keys no-lock ..'"\033[0m"
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
#
## don't lock the LWin button
@@ -325 +325 @@
- win->setToggleButton ( true );
+ win->setToggleButton ( false );
## don't lock the RWin button
@@ -362 +362 @@
- rwin->setToggleButton ( true );
+ rwin->setToggleButton ( false );
#
## generate keycode on click rather than wait for next key-click for keycode
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
#
## for LWin
@@ -326 +326,2 @@
- mod_keys.append ( win );
+ connect ( win, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) );
+ other_keys.append( win );
#
## for RWin
@@ -363 +364,2 @@
- mod_keys.append( rwin );
+ connect ( rwin, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) );
+ other_keys.append( rwin );
EOF
}
## add 'Lock on screen' feature from v0.5
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -529,4 +529,8 @@
m->setItemChecked(mnu_dock, show_dock);
+ mnu_lock = m->insertItem("Lock on screen", this, TQT_SLOT(toggleLock()));
+ bool is_locked = cfg->readBoolEntry("locked",false);
+ m->setItemChecked(mnu_lock,is_locked);
+
//m->insertItem("Configure", this, TQT_SLOT(config()));
m->insertSeparator();
@@ -742,2 +746,14 @@
}
+void MainWidget::toggleLock()
+{
+ bool c = isLocked();
+
+ tray->contextMenu()->setItemChecked ( mnu_lock, !c );
+ setLocked(!c);
+
+ TDEConfig *cfg = TDEApplication::kApplication()->config();
+ cfg->writeEntry ("locked", !c);
+ cfg->sync();
+
+}
void MainWidget::showDock()
#
##
--- src/MainWidget.h
+++ src/MainWidget.h
@@ -69,2 +69,3 @@
void saveState();
+ void toggleLock();
@@ -131,2 +131,3 @@
int mnu_autores;
+ int mnu_lock;
#
##
--- src/DragWidget.cpp
+++ src/DragWidget.cpp
@@ -6,3 +6,3 @@
drag=false;
-
+ locked=false;
}
@@ -17,2 +17,3 @@
gpress=e->globalPos();
+ if (locked)return;
drag=true;
@@ -34,2 +35,12 @@
}
+
+void DragWidget::setLocked(bool mode)
+{
+ locked=mode;
+}
+
+const bool DragWidget::isLocked() const
+{
+ return locked;
+}
#
##
--- src/DragWidget.h
+++ src/DragWidget.h
@@ -14,2 +14,5 @@
+ void setLocked(bool mode);
+ const bool isLocked() const;
+
private:
@@ -24,2 +27,3 @@
TQPoint gpress;
+ bool locked;
#
##
--- src/resizabledragwidget.cpp
+++ src/resizabledragwidget.cpp
@@ -38,2 +38,3 @@
{
+ if (locked)return;
EOF
## fix azerty keyboards shift keys showing caps
## simplify the algorithm and use s for shift characters, leave u for upper case
# * if shift is on, set text as shift character, else use lower character
# * if caps is on, set text as l.upper(), which will be upper case for alpha characters, or lower level for non-alpha characters, else use lower character
# * for lower level or shift characters, set ampersand as a special case
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -905,30 +905,22 @@
KeyCode keycode=v.getKeyCode();
-
+// first level character keysym
KeySym keysym_l = XkbKeycodeToKeysym(display, keycode, 0, 0);
+// second level, ie shift, character keysym
+ KeySym keysym_s = XkbKeycodeToKeysym(display, keycode, 0, 1);
- KeySym keysym_u = XkbKeycodeToKeysym(display, keycode, 0, 1);
-
- long ret = keysym2ucs(keysym_l);
-
- TQString btn_text(TQChar((uint)ret));
+ long retl = keysym2ucs(keysym_l);
- TQChar c((uint)ret);
- if (c=='&')
+ TQChar l((uint)retl);
+ if (l=='&')
v.setText("&&");
else
- v.setText(btn_text);
+ v.setText(l);
- TQString btn_upper(btn_text.upper());
+ long rets = keysym2ucs(keysym_s);
- if (btn_upper==btn_text) {
- ret = keysym2ucs(keysym_u);
- TQChar c((uint)ret);
- if (c=='&')
+ TQChar s((uint)rets);
+ if (s=='&')
v.setShiftText("&&");
else
- v.setShiftText(c);
- }
- else {
- v.setShiftText(btn_upper);
- }
+ v.setShiftText(s);
}
EOF
#
patch -N -p0 << EOF || true
--- src/VButton.cpp
+++ src/VButton.cpp
@@ -22,16 +22,6 @@
{
- if (press==true){
- TQString tu=l.upper();
- if (tu.compare(l)==0){
- //TQPushButton::setText(tu);
- TQPushButton::setText(u);
- }
- else{
- TQPushButton::setText(tu);
- }
-
- }
- else{
+ if (press==true)
+ TQPushButton::setText(s);
+ else
TQPushButton::setText(l);
- }
}
@@ -39,14 +29,7 @@
{
- if (press==true){
+ if (press==true) {
TQString tu=l.upper();
- if (tu.compare(l)==0){
- TQPushButton::setText(tu);
- }
- else{
- TQPushButton::setText(u);
- }
- }
- else{
+ TQPushButton::setText(tu); }
+ else
TQPushButton::setText(l);
- }
}
@@ -60,3 +43,3 @@
{
- u=text;
+ s=text;
}
EOF
#
patch -N -p0 << EOF || true
--- src/VButton.h
+++ src/VButton.h
@@ -31,3 +31,3 @@
unsigned int keycode;
- TQString u;
+ TQString s;
TQString l;
EOF
#
patch -N -p0 << EOF || true
--- src/numpadvbutton.cpp
+++ src/numpadvbutton.cpp
@@ -35,3 +35,3 @@
if (press==true){
- TQPushButton::setText(u);
+ TQPushButton::setText(s);
VButton::setKeyCode(numlock_code);
EOF
## kvkbd --button <color> doesn't work, so
## set a default button background colour which otherwise defaults to system colour
## Changeable from configuration menu
patch -N -p0 << EOF || true
--- src/VButton.cpp
+++ src/VButton.cpp
@@ -11,2 +11,3 @@
//connect(this,TQT_SIGNAL(clicked()),this,TQT_SLOT(sendKey()));
+ setPaletteBackgroundColor ( TQColor("#f0f0f0") );
setFocusPolicy(TQ_NoFocus);
EOF
## base auto font size on main board size otherwise when the num pad is brought into view
## the font size immediately increases in proportion, ie by 703/552.
## and set a more realistic initial font size
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -690,3 +690,6 @@
//double rs = (100.0/700.0)*width();
- double rp = (8.0/600.0)*width();
+ if (extent_visible) {
+ rp = (11.0/600.0)*width() * (552.0/703.0); }
+ else {
+ rp = (11.0/600.0)*width(); }
//fnt.setStretch(rs);
EOF
#
patch -N -p0 << EOF || true
--- src/MainWidget.h
+++ src/MainWidget.h
@@ -130,2 +130,3 @@
double sdxb;
+ double rp;
int mnu_dock;
EOF
########### i18n start ###################
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -519 +519 @@
- m->insertItem ( "Font ...", this, TQT_SLOT ( chooseFont() ) );
+ m->insertItem ( i18n ("Font"), this, TQT_SLOT ( chooseFont() ) );
@@ -521 +521 @@
- mnu_autores = m->insertItem( "Auto resize font",this, TQT_SLOT ( toggleFontAutoRes() ) );
+ mnu_autores = m->insertItem( i18n ("Auto resize font"),this, TQT_SLOT ( toggleFontAutoRes() ) );
@@ -524 +524,0 @@
-
@@ -526 +525 @@
- mnu_dock = m->insertItem ( "Dock widget", this, TQT_SLOT ( showDock() ) );
+ mnu_dock = m->insertItem ( i18n ("Dock widget"), this, TQT_SLOT ( showDock() ) );
@@ -531 +530 @@
- mnu_lock = m->insertItem("Lock on screen", this, TQT_SLOT(toggleLock()));
+ mnu_lock = m->insertItem( i18n ("Lock on screen"), this, TQT_SLOT(toggleLock()));
@@ -537 +536 @@
- m->insertItem ( "Help", h->menu() );
+ m->insertItem ( i18n ("Help"), h->menu() );
@@ -1854 +1853 @@
- TQToolTip::add ( this, "Virtual keyboard" );
+ TQToolTip::add ( this, i18n ("Virtual keyboard") );
EOF
########### i18n end ###################
## it seems that TQColorDialog::getColor() defaults to rrr,ggg,bbb format and
## cfg->readEntry adds double quotes to the string retrieved because
## if the kvkbdrc entry is kbColor=rrr,ggg,bbb, then TQColor(bc) will be invalid [TQColor("rrr,ggg,bbb")] but
## if the kvkbdrc entry is kbColor=#rrggbb then TQColor(bc) will be valid [TQColor("#rrggbb")]
## so name() is used to store the colour in #rrggbb format
## keyboard colour defaults to #cdc0b0
## key/button colour defaults to #f0f0f0
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -39,4 +39,3 @@
#include <tdeapplication.h>
-
-
+#include <ntqcolordialog.h>
## load any existing chosen colours for the keyboard, otherwise default to #cdc0b0
@@ -79,3 +78,7 @@
- setPaletteBackgroundColor ( TQColor("#cdc0b0") );
+ TDEConfig *cfg = TDEApplication::kApplication()->config();
+// if "kbColor" entry doesn't exist - either because it hasn't been saved
+// or kvkbdrc doesn't exist, default to "#cdc0b0"
+ TQColor bc = cfg->readEntry ("kbColor","#cdc0b0");
+ setPaletteBackgroundColor ( TQColor(bc) );
setFocusPolicy ( TQ_NoFocus );
## new configuration menu entries
@@ -524,2 +527,8 @@
+ m->insertSeparator();
+ m->insertItem ( i18n ("Keyboard color"), this, TQT_SLOT ( Colorb() ) );
+
+ m->insertItem ( i18n ("Key color (restart if changed)"), this, TQT_SLOT ( Colork() ) );
+
+ m->insertSeparator();
mnu_dock = m->insertItem ( i18n ("Dock widget"), this, TQT_SLOT ( showDock() ) );
## open ColorDialog and save chosen colours
@@ -573,3 +582,26 @@
-
+void MainWidget::Colorb() // keyboard colour chosen through the configuration menu
+{
+ TDEConfig *cfg = TDEApplication::kApplication()->config();
+// if "kbColor" entry exists, start with that, otherwise start with the default "#cdc0b0"
+ TQColor bc = cfg->readEntry ("kbColor","#cdc0b0");
+ TQColor b = TQColorDialog::getColor( TQColor( bc ) );
+// if the selection of the new colour is cancelled, b will be invalid
+// otherwise the new value is written to kvkbdrc - this must be in the #rrggbb format
+// and as writeEntry produces rrr,ggg,bbb format, .name() is required to convert to #rrggbb
+ if ( b.isValid() ) {
+ cfg->writeEntry ("kbColor", b.name() );
+ cfg->sync();
+ setPaletteBackgroundColor ( TQColor( b ) ); }
+}
+void MainWidget::Colork() // key/button colour chosen through the configuration menu
+{
+ TDEConfig *cfg = TDEApplication::kApplication()->config();
+ TQColor kc = cfg->readEntry ("keyColor","#f0f0f0");
+ TQColor k = TQColorDialog::getColor( TQColor( kc ) );
+ if ( k.isValid() ) {
+ cfg->writeEntry ("keyColor", k.name() );
+ cfg->sync(); }
+// can't set PaletteBackgroundColor because it's in VButton::VButton - needs restart to read configuration entry
+}
void MainWidget::finishInit()
## set initially 150 from the RH edge of the screen to allow for the num pad
## and set 50 from the bottom edge to allow for the panel
@@ -599,3 +631,3 @@
int d_height=235;
- TQRect dflt_geom(screen_geom.width()-d_width,screen_geom.height()-d_height,d_width,d_height);
+ TQRect dflt_geom(screen_geom.width()-d_width-150,screen_geom.height()-d_height-50,d_width,d_height);
--- src/MainWidget.h
+++ src/MainWidget.h
@@ -70,2 +70,4 @@
void toggleLock();
+ void Colorb();
+ void Colork();
--- src/VButton.cpp
+++ src/VButton.cpp
@@ -3,2 +3,4 @@
#include <tqfont.h>
+#include <tdeconfig.h>
+#include <tdeapplication.h>
## load any existing chosen colours for the keys/buttons, otherwise default to #f0f0f0
@@ -11,4 +13,10 @@
//connect(this,TQT_SIGNAL(clicked()),this,TQT_SLOT(sendKey()));
- setPaletteBackgroundColor ( TQColor("#f0f0f0") );
+ TDEConfig *cfg = TDEApplication::kApplication()->config();
+// if "keyColor" entry doesn't exist - either because it hasn't been saved
+// or kvkbdrc doesn't exist, default to "#f0f0f0"
+ TQColor kc = cfg->readEntry ("keyColor","#f0f0f0");
+ setPaletteBackgroundColor ( TQColor(kc) );
+
setFocusPolicy(TQ_NoFocus);
+
resize(30,30);
EOF
<<'comment'
The keyboard geometry is saved when either of the Quit options is selected.
If the num pad is visible [extent_visible=true] when Kvkbd is closed down - ie Quit from the configuration menu - then when it is run again, with the default being extent_visible=false, the keyboard will display without the numpad but at an x-axis size which includes the num pad, ie elongated.
To fix this, add the state of extent_visible to the configuration file and start with that when Kvkbd is re-started.
comment
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -76,5 +76,6 @@
int sty=15;
- extent_visible=false;
TDEConfig *cfg = TDEApplication::kApplication()->config();
+// if the num pad was visible when Kvkbd was 'Quit', the geometry includes it, so start with the num pad in the same state
+ extent_visible = cfg->readBoolEntry("numpad_visible",false);
// if "kbColor" entry doesn't exist - either because it hasn't been saved
@@ -659,2 +660,3 @@
cfg->writeEntry("geometry",geometry());
+ cfg->writeEntry("numpad_visible",extent_visible);
cfg->sync();
EOF
## add tooltips to buttons
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -398,2 +398,3 @@
quit->setPixmap(TQIconSet(SmallIcon("application-exit")).pixmap());
+ TQToolTip::add( quit, i18n( "Hide keyboard" ) );
quit->res();
@@ -406,2 +407,3 @@
extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
+ TQToolTip::add( extent, i18n( "Show num pad" ) );
extent->res();
@@ -571,3 +573,3 @@
popup_menu->setPixmap(TQIconSet(SmallIcon("configure")).pixmap());
-
+ TQToolTip::add( popup_menu, i18n( "Configure" ) );
other_keys.append(popup_menu);
@@ -989,3 +991,3 @@
- TQToolTip::add ( this, "Toggle keyboard visibility" );
+ TQToolTip::add ( this, i18n ("Toggle keyboard visibility") );
}
EOF
## more add tooltips to buttons
## if the num pad was visible, the tooltip continued to show 'Show num pad'
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -742,2 +742,3 @@
extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
+ TQToolTip::add( extent, i18n( "Show num pad" ) );
}
@@ -747,2 +748,3 @@
TQWidget::resize ( (int)sdxb, height() );
+ TQToolTip::add( extent, i18n( "Hide num pad" ) );
}
EOF
## yet more add tooltips to buttons
## if Kvkbd was 'Quit' with the num pad visible, on restart the double arrow was indicating 'Show num pad'
patch -N -p0 << EOF || true
--- src/MainWidget.cpp
+++ src/MainWidget.cpp
@@ -406,4 +406,8 @@
extent->move(526, 85 );
- extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
- TQToolTip::add( extent, i18n( "Show num pad" ) );
+ if (extent_visible) {
+ extent->setPixmap(TQIconSet(SmallIcon("media-seek-backward")).pixmap());
+ TQToolTip::add( extent, i18n( "Hide num pad" ) ); }
+ else {
+ extent->setPixmap(TQIconSet(SmallIcon("media-seek-forward")).pixmap());
+ TQToolTip::add( extent, i18n( "Show num pad" ) ); }
extent->res();
EOF
## for slack-desc
langs="en";for Lang in $I18N;do [[ -s translations/messages/$Lang.po ]] && langs="$langs $Lang";done
listdocs_fn
chown_fn
cd_builddir_fn
cmake \
-DCMAKE_C_FLAGS="$SLKRCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKRCFLAGS" \
-DCMAKE_C_COMPILER=$COMPILER \
-DCMAKE_CXX_COMPILER=$COMPILER_CXX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALL_TDE \
-DWITH_GCC_VISIBILITY="OFF" \
-DBUILD_DOC="ON" \
-DBUILD_TRANSLATIONS="ON" \
-Wno-dev \
..
make_fn
installdocs_fn
strip_fn
mkdir_install_fn
doinst_sh_fn
echo "
# HOW TO EDIT THIS FILE:
# The 'handy ruler' below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: A virtual keyboard for TDE
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: With language support for:
$PRGNAM: $langs
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
" > $PKG/install/slack-desc
makepkg_fn