Discussing the nuts and bolts of software development

Monday, April 02, 2012


Disabling the console switching keys for Android

Some time ago I was doing development on an Android phone and using a BlueTooth keyboard I came across an intriguing behaviour.  Hitting the Alt+Left or Alt+Right key combo, the phone would seemingly stop working and give all the symptoms of a frozen device, no more animated wallpaper and unresponsive touchscreen.  This stems from a functionality inherited from Linux for the desktop.  In this article I will describe the origin of the issue, how to recover from it and how it can be fixed at the kernel level.

Background information

In Linux there exist some special key combinations that are handled at the kernel level.  In this article we'll be looking at the console key combinations, specifically:
* Alt refers to the left Alt key on the keyboard

Let's start with Alt+F1 through F12; these allow accessing the tty's.  On a typical Linux installation Alt+F1 through F6 allows the user to switch between tty1 through tty6 respectively directly and Alt+F7 (F1 in Fedora) is a special tty in which the graphical interface runs.  This can change from distro to distro.

These Alt commands work from the tty's, but don't from the graphical interface.  That's where the Ctrl+Alt+Fn combinations come in, to let you leave the graphical interface.  Now the Alt+Left and Alt+Right commands let you cycle through the tty's to the left or to the right.  i.e. using Alt+Right from tty3 will lead you to tty4.

I don't have these keys on my Android phone...

That's right!  For the most part these key combinations do not come into play on an Android phone as you can't find them on the touchscreen.

When users start connecting BlueTooth or USB keyboards to interface with their Android mobile, that's when the surprise comes for the unsuspecting user.  On my Galaxy S for example, pressing the Alt+Right combo freezes the display.  The live wallpaper stops moving; and the touchscreen becomes unresponsive.  This can be fixed by any of these three options:
That gets the user back to the graphical interface tty and make it responsive again.

Modifying the kernel default key map

The Default kernel keymap in the Android source is located in kernel/drivers/char/defkeymap.map as of Gingerbread (2.3).  Entries in this file look like the following:

keycode  59 = F1               F11              Console_13
        control keycode  59 = F1
        alt     keycode  59 = Console_1
        control alt     keycode  59 = Console_1
keycode 105 = Left
        alt     keycode 105 = Decr_Console
keycode 106 = Right
        alt     keycode 106 = Incr_Console

In our case, we want to disable the combinations associated to Console so in the above entries we simply need to comment the lines that declare these.

keycode  59 = F1               F11              Console_13
        control keycode  59 = F1
#        alt     keycode  59 = Console_1
#        control alt     keycode  59 = Console_1
keycode 105 = Left
#        alt     keycode 105 = Decr_Console
keycode 106 = Right
#        alt     keycode 106 = Incr_Console

There are more entries not shown here that declare Console related key combinations.  The instructions at the top of the defkeymap.c_shipped file read:

/* Do not edit this file! It was automatically generated by   */
/*    loadkeys --mktable defkeymap.map > defkeymap.c          */

When I do run this loadkeys command, the generated file does not match the shipped file provided in the Android source as can be seen by difference in the files size.

$ ll defkeymap.c*
-rw-rw-r--. 1 jpl jpl 18433 Oct 19 12:46 defkeymap.c
-rw-rw-r--. 1 jpl jpl 11007 Oct 12 19:35 defkeymap.c_shipped

Running diff also shows that the provided shipped file has not been generated from the accompanying defkeymap.map file.  Simply generating defkeymap.c from our modified defkeymap.map won't do either as our new defkeymap.c is overwritten with a copy of defkeymap.c_shipped during the build.

What do we do now?  The way I worked around this is a bit tedious but will make sure that we don't lose changes that were applied to the shipped file and not reflected in the defkeymap.map.

Workaround: I generated a defkeymap.c file from the original defkeymap.map and a defkeymap.c from the modified defkeymap.map to remove the Alt+X combinations.  Then I generated the diff of the 2 files and manually applied it to the shipped file.

Labels: , , ,

Something tells me that if you look here you will get some tips on how to write dissertations. It could be a good and helpful hints
Pastinya anda memiliki sebuah tujuan untuk bermain judi dimana tujuan anda harus meraih keuntungan. Tetapi jika anda bermain dengan tergesa gesa maka kemenangan akan sulit anda dapatkan
bandar ceme terpercaya
freebet tanpa deposit
paito warna
syair sgp
Saat memilih pilihan saya untuk taruhan sepak bola, saya ingin mempersenjatai diri dengan pengetahuan terbaru yang tersedia. Salah satu dari banyak teknik yang saya gunakan ketika mempertimbangkan tim untuk bertaruh adalah
data sgp
data sydney
syair sydney
paito warna
live hk 6d
live sydney
These administrations are pocket-accommodating as well as ecstasy for understudies attempting to finish their assignments on schedule.
my assignment help
Custom Article Review Writing Services you secure from the firm are versatile such as Custom Article Review Help and Legitimate Article Review Writing Help and any other form of writing, contact them for assistance.

Great blog, thank you so much for sharing with us. Get a custom mobile app development services at Appslure WebSolution by the professional ios app designers and developers and also get e-commerce app Services
App development company in mumbai
Do you require Affordable Nursing Research Papers Services for your assignments’ needs, but you are unsure of the Legitimate Nursing Research Paper Writing firm to contract? Our Nursing Research Paper Writing Company has credibility and has been providing homework solutions.

Datang dan bergabung bersama Agen Game Taruhan Bola resmi dan terpercaya login sbobet88 mobile
Excellent information Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit the LiveWebTutors website we providing the best assignment help services in Australia.

For More Info: Economics Assignment Help
Google can convert saved XLSX file using its Google sheets program. It is a type of zipping compressed and XML type of spreadsheet. xlsx file is an extension that is used for Microsoft Excel Open XML spreadsheets(XLSX) file created by Microsoft Excel. For more information, visit open xlsx file online.

It is undisputed that Sociology Assignment Writing Services pose challenges for students because preparation takes into consideration a lot of details needed for Sociology Coursework Writing Services and in-depth knowledge on the topic in order to come up with award winning Custom Sociology Research Paper Writing Services.

Many students opt to seek Custom Economics Writing Services since most writing companies are good in Economics Essay Writing Services and Economics Coursework Writing Services.


Very nicely explained and include all important information.I also recommend visiting mobile app development company

Awesome, thanks for the post.

ccskills | tldrlegal | hedonism | gamespot | informationweek | kiva | metal | bloggingmania
Do you have an insight where to acquire Medical Writing Services? Hire a Medical Assignment Help Writer for all your Medical Assignment Writing Services.

Thank you for the post it is very informative information. Get instant help regarding printer related issues at anytime by our expert. I am waiting for the next post. We are available 24 x 7. hp deskjet 2540 printer is offline
Finding Help with Medical Assignment is not easy unless one is keen to establish the best medical research paper writing service company by going through their medical assignment writers qualifications.

I really love to read your post which contains very informative information and i also like the way of explanation of the article. If you want to fix your HP Envy Printer Offline Windows 10 Error regarding issues then call our toll-free number to contact our expert technician to helping you in resolve your issues.
Thanks for sharing blog. Hey!! I want to suggest you for get instant printer help regarding the printer troubleshooting or any new printer setup or you have to find out WPS Pin for HP Printer. Call our toll free number or visit our official website for further details.
Purchase healthcare research paper services and healthcare coursework writing services since students find help when they visit Healthcare Essay Writing Services.

There are many engineering assignment help writing services and Engineering Writing Services to choose from for those stuck with their engineering research paper writing services and engineering term paper writing services.

Purchase biology research paper help services and biology coursework writing services since students find help when they visit Biology Essay Writing Services.

I know Laura well and she is principled, thoughtful, and extremely bright...more power to her!

iso 27001 consultant
Very helpful Post!!! This is the first time I have read a post like this. Find Career tips here.

iso 270012013
Online psychology essay writing services are very difficult to complete and many students are always searching for Help with Psychology Coursework Writing services to help them complete their psychology research paper writing services and psychology case study writing services.
The ultimate goal of descriptive essay help services is to provide Descriptive Essay Writing Services and descriptive essay services since descriptive essay writing help seekers lack time to complete their custom descriptive essay writing services.

Thanks for sharing such a piece of wonderful information. Moreover, it is very true that Entertainment company is ruling the world.
There is everything fame, money but first, you need to set-up your brand availability. Promote your brand, gain customers’ trust, present what the audience wants,
and you will be able to rule the entertainment company.
entertainment company

Accounting assignment writing services have become very popular for students studying finance & accounting coursework writing services as they engage the best online Accounting Writing Services.
Thank you for the auspicious writeup. It if truth be told was a enjoyment account it. Glance advanced to more added agreeable from you! However, how can we keep up a correspondence? We create together, measure always, and revise often, ensuring your customers stay at the focus.
Digital Marketing Services
Professional Human Resource Writing Services is very popular for students in search of human resource case study writing services and human resource research paper services.

Professional Human Resource Writing Services is very popular for students in search of human resource case study writing services and human resource research paper services.

It would be better for you to take help from experts of Dissertation Proposal Writing Service. They have highly qualified experts in every subject who are able to help you in any way they can.
PHP advancement is a well-known scripting language that is utilized to make intelligent and dynamic sites. Today, most business sites are made by utilizing php application development as it accompanies profoundly practical highlights and ease of use. So, organizations ready to make a customer's site with amazing information the executives highlights will require to recruit php development company. Our prime php website development improvement administrations start with understanding the client needs and stretches out to database driven top of the line custom undertaking web frameworks. Recruit devoted PHP engineers from Colan Infotech to plan php web development utilizing Photoshop, Flash etc. The php development India advancement administrations we offer are recorded underneath:
We are one among the best web design company in chennai. Our objective is to deliver clients with trending solutions that add values to their webpages and applications.We are Professional Website Design Services and we have efficient team of experts who are keen to complete the project within specified period. Our HTML5 developers are up to date in latest designing tools and technologies to build interactive websites.If you are looking for web designing services in chennai also you can hire web designer india we are here to help you.
Very nicely explained and include all important information. I also recommend visiting best astrologer in india
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article.
Thanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!

internship in chennai
internship in chennai for cse
internship for mba in chennai
internship in chennai for hr
internship in chennai for mba
companies for internship in chennai
internship in chennai for ece
paid internship in chennai
internship in chennai for biotechnology
internship in chennai for b.com students
Mine is working excellent, but how to revert it. I've disabled the QM. to 1 and delete # in front of the line, but the hardware key still not working. How can I fix it? Please pay someone to write my assignment.
I appreciate for sharing this post keep sharing like this.I also recommend visiting mobile app development company
There is a reliable Healthcare Assignment Writing Service that is very popular for students in search of healthcare coursework writing services and nursing essay writing help services.

Thanks for sharing this solution for disabling the console switching keys for Android, if unable to understand get the assistance of a programming help service.
Great article with valuable information found very resourceful and enjoyed reading it waiting for next blog updated thanks for sharing.
typeerror nonetype object is not subscriptable
There are reliable PowerPoint Presentation Writing Services that are very popular for students in search of powerpoint presentation preparation services and pay for powerpoint presentations.

You can comment on the blog ordering system. You should discuss, it's splendid. Auditing your blog would increase the number of visitors. I was very happy to find this site. Thank you...

Business Analytics Course in Bangalore
I really enjoy reading all of your blogs. I just wanted to let you know that you have people like me who appreciate your work. Definitely a great article. Congratulations! The information you have provided is very helpful.

Data Analytics Course in Bangalore
Thanks for Sharing the Information and keep Writing like this. I also recommend visiting coworking space business
Very important information for general understanding. I use my mobile phone to record my research in the formation of these works leadership in nursing essay, but I will be able to improve the performance using these examples
Thanks for sharing this amazing post. I am a Logo Designer at Logowizpro that is a free logo maker online tool used to design your own logoa and make cool logo designs and cool typography logos. It has 10,000+ logo design templates so you can make a blue and yellow logos, digital art logo and more that suits your brand.

here you can get more info about
Allama iqbal open university
I have to search sites with relevant information ,This is a
wonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Training in Bangalore
Your Blog is incredible with unique content. Please visit Sindh High Court to get latest Daily Cause List, Memorandum Civil, Criminal, Court Writ, Latest Jobs and Electronic Case Management System in Sindh High Court.
AKGVG & Associates is the best organization and team of accountant experts. We provide services like Gst Registration In Delhi Company Compliance & Advisory Services India Book Keeping & Accounting Fixed Asset Register (Far) Maintenance and Far Updation In Software etc. Apart from this we also help Business to grow fast in 2021 with our business advisory firm.
Very informative blog, and beautifully elaborating the complete information about the topic. We are from the same domain emerging as the top mobile app development company for versatile app creation services. You can email us at sales@appsquadz.com or Phone Number: +91-9717270746
No missing, correspondingly as buts, your blog is epic. I'm going to bookmark it and plan to restore out of nowhere. If you have some problem with Hp Error 0x61011bed click the link. Website: Hp Printer Error 0x61011bed
There are numerous explanations for ordinance printer not printing blunders, without knowing the reasons you can't be resolve group Canon Printer Not Printing Color issue.
Thanks for Sharing a Very Informative Post & I read Your Article & I must say that is very helpful post for us.
Data Science Course in Pune
Python Classes in Pune
Fantastic blog with excellent information and valuable content just added your blog to my bookmarking sites thank for sharing.
Data Science Course in Chennai

According to the research, a woman in Russian culture is rarely elevated to her human ideal, her beauty is rarely elevated above matter and the dignity of her soul is rarely expressed. On the contrary, the Ukrainian woman symbolizes sublime feelings, flight of the soul, and passion. Whereas Russian women are mundane reality and material values. know one site to find ukrainian bride, on this site you will find the best Ukrainian brides.
Amazing post, the audience will be engaged at best with your blog, we are leading as AWS live class software development company willing to contribute to the educational sector with high end secured software for live classes.
Hey, I believe that this is an individual choice of everyone, you should try and understand whether it is yours or not. But I can recommend a site with a review, where there are ratings of different sites. This is. I hope this makes it easier for you to choose and search, good luck! live singapore live draw singapore
Hey, I believe that this is an individual choice of everyone, you should try and understand whether it is yours or not. But I can recommend a site with a review, where there are ratings of different sites. This is. I hope this makes it easier for you to choose and search, good luck!

live singapura

Thanks for sharing such an informative post, being a renowned web app development company we are willing to support local small businesses with web app development services to engage audiences.
Have a nice day! A well knowledgeable and high word content I have got from your site. Every word is sounding good and meaningful. This is an informative website and I am sure we will always gain something unique about fashion, lifestyle, historical some like this. paito warna singapore

Awesome information! I as of late ran over your online journal and have been perusing along. I thought I would leave my first remark. I don't recognize what to say with the exception of that I have.


This is such an extraordinary asset, to the point that you are giving and you give it away for nothing. I love seeing sites that comprise the benefit of giving a quality asset to free.

Extremely decent blog and articles. I am really extremely glad to visit your blog. Presently I am discovered which I really need. I check your blog regular and attempt to take in something from your blog.

I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
Data Science Course in Chennai
All of these posts were incredible perfect. It would be great if you’ll post more updates and your website is really cool and this is a great inspiring article.
Artificial Intelligence course in Chennai
Thanks for sharing this informative content.,
Leanpitch provides online training in Scrum Master Certifiation during this lockdown period everyone can use it wisely.
Join Leanpitch 2 Days CSM Certification Workshop in different cities.

Scrum master certification online

CSM certification online
Thanks for sharing this informative content.,
Leanpitch provides online training in Scrum Master Certifiation during this lockdown period everyone can use it wisely.
Join Leanpitch 2 Days CSM Certification Workshop in different cities.
CSM online

CSM online certification
Thanks for sharing this informative content.,
Leanpitch provides online training in Scrum Master Certifiation during this lockdown period everyone can use it wisely.
Join Leanpitch 2 Days CSM Certification Workshop in different cities.
CSM online training

CSM training online

I have voiced some of the posts on your website now, and I really like your blogging style. I added it to my list of favorite blogging sites and will be back soon ...

Digital Marketing Training in Bangalore
You have completed certain reliable points there. I did some research on the subject and found that almost everyone will agree with your blog.

Data Science Training in Bangalore
I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.

Artificial Intelligence Training in Bangalore

The Extraordinary blog went amazed by the content that they have developed in a very descriptive manner. This type of content surely ensures the participants explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.

Machine Learning Course in Bangalore
If you are an Interior fanatic then this is your chance to seal the deal with the best office furniture Manufacturers. CPM systems have cracked every aspect of delivering the best Office furniture to their clients. Whether it’s strictly time-framed deliveries, precise installations, a wide range of models and designs, or a supportive team of field experts. Our collection goes through rigorous quality control before it is turned over to the clients. Visit our website to get your ideal office furniture manufacturer.

CPM Systems provides its clients the ultimate state of comfort and style that arrives with the union of experience and knowledge and office furniture Manufacturer. Being a reputed name amongst the Top office furniture Manufacturers, CPM Systems has been delivering contemporary and classy office interiors to the community.

Thanks for sharing the Blog Keep Sharing like this. I also recommend visiting lash extension supplies
Thanks for sharing the Blog Keep Sharing like this. I also recommend visiting lash extension supplies
The national anthem of Greece is called 'Ýmnos eis tīn Eleutherían', which in English means 'Hymn to Liberty'. It was adopted in 1865. The lyrics have been written by Dionýsios Solomós and the music has been composed by Nikolaos Mantzaros.

Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?