backKey and now searchKey and menuKey

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

backKey and now searchKey and menuKey

Post by BarrySumpter » Thu Mar 29, 2012 1:41 pm

Thank you RunRev.

I was really missing being able to trap these hardware keys.

Search button, Back Buttton, Menu Button

Code: Select all

on searchKey
   answer "You pressed the searchKey"
end searchKey

on backKey
   answer "You pressed the backKey"
   if the number of this card is 1 then
      pass backKey
   else
      go to the previous card
   end if
end backKey

on menuKey
   answer "You pressed the menuKey"
end menuKey
My hd2 did NOT have a search button
I remapped the phone/button (far left) to be a Search Button
Notes from HDA:
All files related to key mappings are located in /system/usr/keylayout . The qwerty.kl is the one that android is defaulting to if not specified otherwise. There may be some other kl files in the folder, but the vendor specific file is just "left overs" from the ROM rip (in some cases).

Remap Dial Button to be a Search Button
Key 321 CALL WAKE_DROPPED
Key 61 CALL WAKE_DROPPED
to
Key 321 SEARCH
Key 61 SEARCH
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “Android Deployment”