PocketMagic

PocketMagic

Where Technology meets magic


Android
47 Posts
BlackBerry
4 Posts
Electronics
69 Posts
Hardware
123 Posts
High Voltage
49 Posts
Image processing
2 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
76 Posts
Symbian
2 Posts
Tubes
20 Posts
Windows
3 Posts
Windows Mobile
11 Posts

Top Articles!       See PocketMagic on Facebook


Building a robot – Part 2 | 8815 Views | Rate 67.29
Building a robot – Part 2
uRADMonitor - Online Radiation monitoring station | 16077 Views | Rate 66.99
uRADMonitor - Online Radiation monitoring station
Bluetooth and iOS - Use Bluetooth in your iPhone apps | 21955 Views | Rate 65.15
Bluetooth and iOS - Use Bluetooth in your iPhone apps
NMEA GPS Library for AVR Microcontrollers | 5806 Views | Rate 51.38
NMEA GPS Library for AVR Microcontrollers
Programmatically Injecting Events on Android - Part 2 | 6499 Views | Rate 46.76
Programmatically Injecting Events on Android - Part 2
Simple Switched power Supplies | 18981 Views | Rate 45.96
Simple Switched power Supplies
Cartoon yourself using Leptonica | 134 Views | Rate 44.67
Cartoon yourself using Leptonica
A 3D Carousel View for Android | 205 Views | Rate 41
A 3D Carousel View for Android

 
  

Android overriding Menu key to disable keyboard popup


By Radu Motisan Posted on March 19th, 2011 , 1028 Views (Rate 1.25)



  

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:

Atmega8 and enc28J60 for ethernet support | 8810 Views | Rate 27.28
Atmega8 and enc28J60 for ethernet support
How to make metallic sodium | 1403 Views | Rate 26.98
How to make metallic sodium
Tube: USN-5J29 | 1074 Views | Rate 26.2
Tube: USN-5J29
Tube: GP-5 (ГП-5) | 623 Views | Rate 25.96
Tube: GP-5 (ГП-5)
How to set the AVR Fusebits | 2523 Views | Rate 25.48
How to set the AVR Fusebits
Dual H-Bridge for controlling two motors | 2082 Views | Rate 25.08
Dual H-Bridge for controlling two motors

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

Please copy the string KPc9iM to the field below: