Introduction to KeyHelper

From OESF

Revision as of 15:15, 28 November 2006 by B.Gates (Talk | contribs)
Jump to: navigation, search
See also

Contents

Introduction

Many of you are probably aware of the keymapping abilities of KeyHelper, but you may not be aware of some of the other features including:

  • Changing key repeat rates
  • Task Switching
  • Task Selection from list
  • Application launching
    • from hot key
    • from menu

Most of the examples below were taken from this very helpful tutorial on KeyHelper (Japanese) and from the KeyHelper Home Page. Any mistakes in this document are mine and probably due to my poor Japanese and typing skills.

Note that if you're running Cacko Qtopia ROM version 1.21 and above, KeyHelper functionality is merged with Cyrillica keyboard layout applet. No separate KeyHelper package installation is requried.

The following example is a simple keyhelper.xml files which sets the Kana key (1st Japanese key) to Ctrl, turns on toggle for Shift, maps Fn+O and Fn+P as { and } and defines Home as the task switch key.


<?xml version="1.0"?>
<keyhelper>
<modifiers>
<define key="F26" type="Control">
<release key="F31"/>
</define>
<define key="F12" type="User1">
</define>
<define key="Shift" type="Shift" toggle="True"/>
</modifiers>
<mappings>
<define code="2015">
<map_modifier Shift="On"/>
<map key="Less"/>
</define>
<define code="2016">
<map_modifier Shift="On"/>
<map key="Greater"/>
</define>
</mappings>
<repeater>
<repeat delay="300" period="30"/>
</repeater>
<extensions>
<define key="F12" kind="switch">
<modifier Shift="On"/>
</define>
<define key="All" kind="launch">
<modifier User1="On"/>
</define>
</extensions>
</keyhelper>

By copying and pasting this into a file named keyhelper.xml and copying it into /home/zaurus/Settings and running khctl reload from the console you will have a Ctrl key, Shift will be a toggle, Fn+O/P will give {/} and Shift+Home will switch between running apps.

The keyhelper.xml file has 4 sections

  1. <modifiers> - changes/assigns keys such as Shift, Ctrl, Alt as well as the ornamental keys Home, Address etc.
  2. <mappings> - changes mapping of normal keys or key combos
  3. <repeater> - sets the key repeat rate
  4. <extensions> - changes what keys are used for special keyhelper functions - task switcher, task selector and launcher.

I'll explain these section in more detail as well as give examples below.

Modifiers

Some examples will help to explain the format of this section.

<define key="F26" type="Control" mapping="True">
<release key="F31"/>
</define>

<define key="F26" type="Control" mapping="True"> Sets [[Kana] key (first Japanese key) to be the control key, key= can also be replaced by code= if you prefer to set a key combination to be a modifier key. type= is one of the "Ornamental" keys ([[Address],[[Home],[[Calendar],[[Mail],[[Menu]) or the standard modifier keys ([[Shift],[[Ctrl],[[Alt]). Setting mapping="True" and not supplying a mapping in the <mapping> section makes this key lose its normal function. In the above example the [[Kana] key will no longer switch between hiragana and katakana - it will only act as [Ctrl].

<define key="Shift" type="Shift" toggle="True"/>

This short example higlights the toggle="True" feature which turns on the toggle feature for modifier keys.

Mapping Keys

Mapping keys is a relatively simple matter of working out the key/code you want to change and the key/code you want it to be. Here are 2 examples

<define code="2015">
<map_modifier Shift="On"/>
<map key="Less"/>
</define>

This is a simple example to start <define code="2015"> is the key code we want to change (in this case [[Fn]+O), we could also use <define key="P"> if we wanted to change the function of the P key. <map key="Less"/>' identifies what we want the changed key/code to be. It can also be modified with [[Alt],[[Ctrl],[[Shift] etc with the <map_modifier Shift="On"/> line. In this example we have changed [[Fn]+O to [[Shift]+[[Less] ({ key).

<define key="F26">
<modifier Shift="On"/>
<map key="Alt"/>
<map_modifier Shift="Off"/>
</define>

The second example maps the [[Alt] key to [[Shift]+[[Ctrl] - remember that the first Japanese key = [[Ctrl]. <define key="F26"> is the first Japanese key, <modifier Shift="On"/> means that we only map the key when pressed with [[Shift], as in the previous example <map key="Alt"/> sets the key we want, and the <map_modifier Shift="Off"/> cancels the [[Shift] button.

Key Repeat

<repeater>
<repeat delay="300" period="30" mode="1"/>
</repeater>

This is a nice simple example that turns on key repeat, with a delay of 300 milliseconds and a repeat rate of 30 milliseconds.

KeyHelper Extensions

KeyHelper offers a number of extended features that are quite useful. The example below shows how to set up task switching and task selection.

<define key="F12" kind="switch">
<modifier Shift="On"/>
</define>
<define key="F11" kind="select">
<modifier Shift="On"/>
</define>

With this example [[Shift]+[[Home] can be used to switch between running applications, while [[Shift]+[[Menu] will bring up a list of active applications allowing you to select which one to switch to.

More to come on using KeyHelper as a program launcher and other goodies once I understand and work out what I'm doing - StuBear

Tips

Launch1 Keys

If you define a launch1 key in your keyhelper.xml, you will be able to "launch" a macro by pressing a key with no modifier (i.e. just the key and not launch+key).

Example:

keyhelper.xml:

   <extensions>
       <define key="All" kind="launch1" />
   </extensions>

keyhelper.conf (page down for netfront3 in landscape view):

   [Launch1_netfront3]
   Space = @qcop	QPE/InputHelper 'mouse(QString)' "click 620 384"


Launching applications

There are at least two ways to launch an applications: via the launcher or via qcop (which let's you pass an argument to the application). See this example:

   [Launch]
   N = Applications/netfront3
   T = @qcop	QPE/System 'execute(QString)' qkonsole

Press down the launch key (as defined in your keyhelper.xml) + n or t to run these applications.

By Application

External USB Keyboard

Switching Layouts

In my setup, two keyhelper.xml files are stored in ~/Settings: keyhelper_zaurus.xml (which is linked to keyhelper.xml) and keyhelper_use.xml. I (tml) use the following opie-sh script to switch between these two files:

   #!/bin/bash
   
   function doit {
       echo Switching to: $1
       cd /home/zaurus/Settings
       khctl load keyhelper_$1.xml
   }
   
   opie-sh -m -w -M "Switch Keyhelper Layout" -0 Cancel -1 Zaurus -2 USB
   RV=$?
   case $RV in
   1)
       doit zaurus;:
   2)
       doit usb;:
   *)
       echo Nope ... $RV
   esac

Layouts

Here is the xml file for an external USB keyboard:

Keyhelper German Keyboard Layout 
I use a small benq keyboard; the <>| key isn't recognized by keyhelper, which is why it is mapped to the ´` key (´` is mapped to control-´`); launch is mapped to the print key

eversearch airline tickets eversearch continental airline eversearch airline reservation eversearch discount airline tickets eversearch air travel discount eversearch air travel fare eversearch air travel eversearch business debt eversearch consolidate debt eversearch credit card debt eversearch debt collection eversearch debt collector eversearch debt consolidation eversearch debt counseling eversearch debt help eversearch debt management eversearch debt problem eversearch debt reduction eversearch debt relief eversearch debt settlement eversearch debt solution eversearch eliminate credit card debt eversearch online debt eversearch auto insurance eversearch auto insurance quote eversearch automobil insurance eversearch business insurance eversearch car insurance eversearch health insurance eversearch home insurance eversearch insurance leads eversearch life insurance eversearch medical insurance eversearch state farm life insurance eversearch term life insurance eversearch travel insurance eversearch whole life insurance eversearch dental insurance eversearch advance cash loan eversearch auto loan calculator eversearch auto refinance loan eversearch bad credit auto loan eversearch bad credit loan eversearch best home equity eversearch business loan eversearch cash loan eversearch debt consolidation loan eversearch fast cash loan eversearch home equity loan eversearch home improvement loan eversearch loan consolidation eversearch loan with bad credit eversearch mortgage loan eversearch no credit check loan eversearch payday loan eversearch personal loan eversearch student loan consolidation eversearch unsecured loan eversearch 2nd mortgage eversearch bad credit mortgage eversearch best mortgage rate eversearch california mortgage eversearch commercial mortgage eversearch florida mortgage eversearch home mortgage eversearch mortgage calculator eversearch mortgage lead eversearch mortgage loan eversearch mortgage quote eversearch nationwide mortgage eversearch refinance mortgage eversearch second mortgage eversearch bedroom furniture eversearch discount furniture eversearch furniture store eversearch office furniture eversearch patio furniture eversearch outdoor furniture eversearch garden furniture eversearch kitchen furniture eversearch computer furniture eversearch antique furniture eversearch furniture modern eversearch contemporary furniture eversearch liposuction

air travel fare at: air travel fare auto refinance loan at: auto refinance loan best home equity at: best home equity debt collector at: debt collector debt problem at: debt problem eliminate credit card debt at: eliminate credit card debt leather sofa at: leather sofa modern sofa at: modern sofa nationwide mortgage at: nationwide mortgage online debt at: online debt sofa express at: sofa express state farm life insurance at: state farm life insurance 2nd mortgage at: 2nd mortgage advance cash loan at: advance cash loan air mattress at: air mattress air travel at: air travel air travel discount at: air travel discount airline reservation at: airline reservation airline tickets at: airline tickets antique furniture at: antique furniture auto insurance at: auto insurance auto insurance quote at: auto insurance quote auto loan calculator at: auto loan calculator automobil insurance at: automobil insurance baby furniture at: baby furniture bad credit auto loan at: bad credit auto loan bad credit loan at: bad credit loan bad credit mortgage at: bad credit mortgage bedroom furniture at: bedroom furniture best mortgage rate at: best mortgage rate business debt at: business debt california mortgage at: california mortgage car insurance at: car insurance commercial mortgage at: commercial mortgage computer furniture at: computer furniture consolidate debt at: consolidate debt contemporary furniture at: contemporary furniture continental airline at: continental airline credit card debt at: credit card debt debt collection at: debt collection debt consolidation at: debt consolidation debt consolidation loan at: debt consolidation loan debt counseling at: debt counseling debt help at: debt help debt management at: debt management debt reduction at: debt reduction debt relief at: debt relief debt settlement at: debt settlement debt solution at: debt solution dental insurance at: dental insurance discount airline tickets at: discount airline tickets discount furniture at: discount furniture discount mattress at: discount mattress electric heater at: electric heater fast cash loan at: fast cash loan furniture kid at: furniture kid furniture modern at: furniture modern furniture store at: furniture store garden furniture at: garden furniture gas heater at: gas heater health insurance at: health insurance home equity loan at: home equity loan home improvement loan at: home improvement loan home insurance at: home insurance home mortgage at: home mortgage insurance leads at: insurance leads kerosene heater at: kerosene heater kitchen furniture at: kitchen furniture life insurance at: life insurance loan consolidation at: loan consolidation loan with bad credit at: loan with bad credit medical insurance at: medical insurance mortgage calculator at: mortgage calculator mortgage lead at: mortgage lead mortgage loan at: mortgage loan mortgage quote at: mortgage quote office furniture at: office furniture outdoor furniture at: outdoor furniture patio furniture at: patio furniture patio heater at: patio heater portable heater at: portable heater propane heater at: propane heater refinance mortgage at: refinance mortgage second mortgage at: second mortgage sectional sofa at: sectional sofa sleeper sofa at: sleeper sofa sofa bed at: sofa bed space heaters at: space heaters term life insurance at: term life insurance travel insurance at: travel insurance unsecured loan at: unsecured loan water heater at: water heater wheel chair at: wheel chair whole life insurance at: whole life insurance business insurance at: business insurance business loan at: business loan cash loan at: cash loan base business home at: base business home business home opportunity at: business home opportunity business home internet at: business home internet business home idea at: business home idea business home work at: business home work business home online at: business home online best business home at: best business home business home start at: business home start business home small at: business home small business computer home at: business computer home fruits basket at: fruits basket visa credit card at: visa credit card starting a business at: starting a business small business at: small business job opportunity at: job opportunity investment opportunity at: investment opportunity internet business at: internet business home based business at: home based business franchise sale at: franchise sale franchise opportunity at: franchise opportunity employment opportunity at: employment opportunity career opportunity at: career opportunity business travel at: business travel business to business at: business to business business software at: business software business services at: business services business school at: business school business resource at: business resource business plan at: business plan business opportunity at: business opportunity business franchise at: business franchise business for sale at: business for sale business degree at: business degree business credit card at: business credit card business check at: business check business card at: business card business and economy at: business and economy better business bureau at: better business bureau housing market at: housing market corporate housing at: corporate housing senior housing at: senior housing affordable housing at: affordable housing rental housing at: rental housing temporary housing at: temporary housing housing prices at: housing prices affordable dentures at: affordable dentures affordable apartment at: affordable apartment stock trading at: stock trading stock market at: stock market stock quote at: stock quote trade stock at: trade stock stock broker at: stock broker buy stock at: buy stock stock exchange at: stock exchange stock investment at: stock investment alternative bankruptcy at: alternative bankruptcy attorney legal services at: attorney legal services avoid bankruptcy at: avoid bankruptcy bankruptcy services at: bankruptcy services dwi attorney at: dwi attorney attorney injury personal at: attorney injury personal banking investment at: banking investment bankruptcy attorney at: bankruptcy attorney bankruptcy card credit at: bankruptcy card credit bankruptcy filing at: bankruptcy filing bankruptcy law at: bankruptcy law bankruptcy loan at: bankruptcy loan bankruptcy personal at: bankruptcy personal credit equity home line at: credit equity home line estate investment real at: estate investment real fidelity investment at: fidelity investment finance investment at: finance investment investment online at: investment online investment property at: investment property personal injury attorney at: personal injury attorney arizona home new at: arizona home new arizona lottery at: arizona lottery atlanta georgia real estate at: atlanta georgia real estate colorado home loan at: colorado home loan colorado lottery at: colorado lottery connecticut lottery at: connecticut lottery hawaii car rental at: hawaii car rental hawaii mortgage at: hawaii mortgage indiana mortgage at: indiana mortgage iowa attorney at: iowa attorney iowa travel at: iowa travel lottery maryland at: lottery maryland airline alaska at: airline alaska alabama lawyer at: alabama lawyer alabama real estate at: alabama real estate alaska cruise at: alaska cruise alaska estate real at: alaska estate real alaska travel at: alaska travel alaska vacation at: alaska vacation arizona estate real at: arizona estate real arizona mortgage at: arizona mortgage arkansas real estate at: arkansas real estate california car insurance at: california car insurance california lottery at: california lottery california mortgage loan at: california mortgage loan california real estate at: california real estate casino louisiana at: casino louisiana colorado college at: colorado college colorado real estate at: colorado real estate colorado vacation at: colorado vacation connecticut college at: connecticut college connecticut real estate at: connecticut real estate delaware estate real at: delaware estate real estate maine real at: estate maine real estate maryland real at: estate maryland real florida lottery at: florida lottery florida mortgage at: florida mortgage florida real estate at: florida real estate florida travel at: florida travel florida vacation at: florida vacation hawaii cruise at: hawaii cruise hawaii hotel at: hawaii hotel hawaii real estate at: hawaii real estate hawaii travel at: hawaii travel hawaii vacation at: hawaii vacation hotel california at: hotel california idaho real estate at: idaho real estate illinois real estate at: illinois real estate indiana casino at: indiana casino indiana real estate at: indiana real estate iowa real estate at: iowa real estate kansas real estate at: kansas real estate kentucky real estate at: kentucky real estate louisiana real estate at: louisiana real estate maryland mortgage at: maryland mortgage massachusetts real estate at: massachusetts real estate italian airline at: italian airline italian charm bracelet at: italian charm bracelet italian charm wholesale at: italian charm wholesale italian charm at: italian charm italian consulate at: italian consulate italian food at: italian food italian furniture at: italian furniture italian gift at: italian gift italian greyhound at: italian greyhound italian jewelry at: italian jewelry italian leather at: italian leather italian pottery at: italian pottery italian recipes at: italian recipes italian restaurant at: italian restaurant italian shoes at: italian shoes italian villa rental at: italian villa rental italian wine at: italian wine michigan lottery at: michigan lottery university of michigan at: university of michigan michigan wolverines at: michigan wolverines michigan real estate at: michigan real estate michigan lawyer at: michigan lawyer lodging in michigan at: lodging in michigan minnesota real estate at: minnesota real estate minnesota lawyer at: minnesota lawyer minnesota jobs at: minnesota jobs minnesota business at: minnesota business minnesota new home at: minnesota new home mississippi real estate at: mississippi real estate mississippi college at: mississippi college mississippi casino at: mississippi casino missouri mortgage at: missouri mortgage estate missouri real at: estate missouri real estate montana real at: estate montana real furniture mart nebraska at: furniture mart nebraska nebraska university at: nebraska university estate nebraska real at: estate nebraska real furniture nebraska at: furniture nebraska mortgage nebraska at: mortgage nebraska reno nevada real estate at: reno nevada real estate nevada real estate at: nevada real estate nevada mortgage at: nevada mortgage nevada mortgage loan at: nevada mortgage loan nevada hotel at: nevada hotel nevada home at: nevada home new hampshire real estate at: new hampshire real estate university of new hampshire at: university of new hampshire new hampshire lodging at: new hampshire lodging new jersey lottery at: new jersey lottery new jersey real estate at: new jersey real estate new jersey attorney at: new jersey attorney new jersey hotel at: new jersey hotel estate mexico new real at: estate mexico new real new mexico travel at: new mexico travel new york hotel at: new york hotel real estate new york at: real estate new york north carolina real estate at: north carolina real estate north carolina mortgage at: north carolina mortgage north dakota real estate at: north dakota real estate north dakota mortgage at: north dakota mortgage lottery ohio at: lottery ohio estate ohio real at: estate ohio real new home ohio at: new home ohio oklahoma real estate at: oklahoma real estate oregon real estate at: oregon real estate university of oregon at: university of oregon estate pennsylvania real at: estate pennsylvania real hotel pennsylvania at: hotel pennsylvania attorney pennsylvania at: attorney pennsylvania pennsylvania travel at: pennsylvania travel rhode island college at: rhode island college rhode island mortgage at: rhode island mortgage island rhode travel at: island rhode travel south carolina real estate at: south carolina real estate south carolina mortgage loan at: south carolina mortgage loan south carolina attorney at: south carolina attorney dakota mortgage south at: dakota mortgage south dakota south travel at: dakota south travel tennessee real estate at: tennessee real estate tennessee travel at: tennessee travel texas holdem at: texas holdem texas real estate at: texas real estate new home texas at: new home texas utah real estate at: utah real estate utah jobs at: utah jobs utah home at: utah home utah home for sale at: utah home for sale utah mortgage at: utah mortgage vermont real estate at: vermont real estate vermont travel at: vermont travel vermont vacation at: vermont vacation vermont hotel at: vermont hotel virginia real estate at: virginia real estate virginia beach hotel at: virginia beach hotel virginia travel at: virginia travel hotel washington at: hotel washington washington real estate at: washington real estate wisconsin real estate at: wisconsin real estate wisconsin jobs at: wisconsin jobs wyoming real estate at: wyoming real estate
Personal tools