PocketMagic

PocketMagic

Where Technology meets magic


Android
45 Posts
BlackBerry
4 Posts
Electronics
68 Posts
Hardware
120 Posts
High Voltage
49 Posts
iPhone
4 Posts
Linux
2 Posts
Nuclear
20 Posts
Optics
11 Posts
Photography
7 Posts
Photoshop
3 Posts
Research
19 Posts
Reviews
18 Posts
Robotics
8 Posts
Security
7 Posts
Software
73 Posts
Symbian
2 Posts
Tubes
18 Posts
Windows
3 Posts
Windows Mobile
11 Posts

Top Articles!       See PocketMagic on Facebook


uRADMonitor - Online Radiation monitoring station | 15019 Views | Rate 69.86
uRADMonitor - Online Radiation monitoring station
Bluetooth and iOS - Use Bluetooth in your iPhone apps | 18572 Views | Rate 59.53
Bluetooth and iOS - Use Bluetooth in your iPhone apps
NMEA GPS Library for AVR Microcontrollers | 4902 Views | Rate 55.7
NMEA GPS Library for AVR Microcontrollers
Programmatically Injecting Events on Android - Part 2 | 5154 Views | Rate 45.21
Programmatically Injecting Events on Android - Part 2
Building a robot – Part 2 | 4732 Views | Rate 44.64
Building a robot – Part 2
Simple Switched power Supplies | 16361 Views | Rate 42.17
Simple Switched power Supplies
Capacitor Discharge Microspot Welder / Cutter | 11487 Views | Rate 36.58
Capacitor Discharge Microspot Welder / Cutter
Atmega8 and Nokia 5110 LCD  | 1598 Views | Rate 34.74
Atmega8 and Nokia 5110 LCD

 
  

Android overriding Menu key to disable keyboard popup


By Radu Motisan Posted on March 19th, 2011 , 874 Views (Rate 1.1)



  




The standard functionality on Android devices makes the software keyboard popup every time the Menu is long pressed. This may be annoying or unwanted. To disable this default functionality, all one needs to do is to intercept the Menu key down event.

  1.  
  2. @Override
  3. public boolean onKeyDown(int keyCode, KeyEvent event) {
  4. if (!b.isChecked())
  5. return super.onKeyDown(keyCode, event);
  6.  
  7. if (keyCode == KeyEvent.KEYCODE_MENU) {
  8. return true;
  9.  
  10. }else return super.onKeyDown(keyCode, event);
  11. }
  12.  

If the checkbox is on, the MENU long press will be overridden and the keyboard won't open. A side effect is that also short MENU presses won't work anymore (like when trying to open a predefined application menu).

Source code: OverridingMenu






  

More on PocketMagic:

How to set the AVR Fusebits | 1770 Views | Rate 23.92
How to set the AVR Fusebits
ATMega128 and HD44780 LCD using 3 Wires with the 74HC164 | 2111 Views | Rate 22.95
ATMega128 and HD44780 LCD using 3 Wires with the 74HC164
Repairing a Victoreen CDV-700 6B Dosimeter  | 181 Views | Rate 22.63
Repairing a Victoreen CDV-700 6B Dosimeter
Dual H-Bridge for controlling two motors | 1265 Views | Rate 21.81
Dual H-Bridge for controlling two motors
USBAsp -  AVR USB Programmer  | 8215 Views | Rate 21.17
USBAsp - AVR USB Programmer
Developing for Blackberry 10 | 102 Views | Rate 20.4
Developing for Blackberry 10

Thank you for commenting. Your comment won't show until approved, which can take some time.

Please copy the string 2NMRLO to the field below: