Chuck's Code Blog

Assorted solutions and musings

Button Map for the Samsung Q1-Ultra UMPC.

I’m working on a home automation project that involves amongst other things creating a software application that operates on Windows XP Tablet Edition running on a touchscreen-enabled Samsung Q1-Ultra Ultra Mobile Personal Computer (or UMPC).

One of the requirements of this application is that the UMPC will operate in a kiosk mode – okay simple enough, [perhaps I’ll post some information on accomplishing this by trapping certain key combinations and using the Windows Group Policy Editor if anyone is interested] but for this article the question is, “How do I disable some of the hardware buttons on the computer?”

We still want some of the hardware buttons to be available to the user.  Buttons such as “Vol-“, “Vol+”, as well as the traditional keyboard characters will be very useful, so we don’t want to disable them.  Other buttons will come in quite handy for purposes other than their intended uses, for example the arrow up and arrow down buttons on the user pad to the right will provide the user with handy Volume Up and Volume Down buttons (the Vol- and Vol+ buttons are used to control the volume locally on the UMPC where as these arrow up and arrow down buttons will send a control code to the AMX brain that will in-turn adjust the actual source volume for the various routed zones.

The first step of this task after determining the list of which hardware buttons we need to control or disable, is to identify how the system addresses these hardware keys.  I wrote a simple application that hooked into the low-level keyboard handler and trapped all values that came through.  From there I was able to create a table that shows for each hardware button what the BIOS key value is in both Hex and Decimal as well as the constants defined for those values in the Windows API WinUser.DLL library file and the .NET Windows.Forms.Key Keys enumerator.  Both of these are necessary because I wanted to trap some key codes in a dll and utilize some of the keys within the managed C# application.

Below I have provided the table showing the button mappings and the buttons’ relative positions on the UMPC.

Q1-U_Left Q1-U_Right

Button BIOS (Hex) BIOS (Dec) Windows (Hex) WinUser DLL Constant .Windows.Forms.Key
▲ Up
0x58 088 0xFF VK_X Keys.X
▼ Down 0x59 089 0xFF VK_Y Keys.Y
◄ Left
0x56 086 0xFF VK_V Keys.V
► Right 0x57 087 0xFF VK_W Keys.W
Internet 0x32 050 0xAC VK_2 Keys.D2
Menu 0x54 084 0xFF VK_T Keys.T
UDF 0x6E 110 0xFF VK_DECIMAL Keys.Decimal
Q \ AV 0x74 116 0xFF VK_F5 Keys.F5
Shutter 0x64 100 0xFF VK_NUMPAD4 Keys.NumPad4

One of the biggest concerns was the Internet button.  In a kiosk-type application that does not use the Internet, this button is a huge security hole in that people could launch Internet explorer and in the address bar use “File///…” and access anything within the UMPC.  It was a relief to me when I discovered that Samsung had used a standard keyboard key for the number 2 (above the Q and W on a QWERTY keyboard).  This meant there is a way to trap for that keystroke and prohibit it from launching the (in this case) Internet Explorer application.

November 4, 2009 Posted by | UMPC | , , , , | Leave a comment