Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Problem with Ultra Slim Keyboard

Tue May 17, 2016 5:09 pm

Hi guys

I've sort of hit a snag with this ultra slim keyboard https://shop.pimoroni.com/products/ultr ... h-keyboard

Seemed to work perfectly fine with my RPI, until i realised today while running Vice. I dont have any flipping function keys. I was tapping away at F12, thinking the emulator was bust and it's my darn keyboard. I plug in a spare wired keyboard and was able to get the config screen up. Back on the bluetooth keyboard, I tried assigning a new key to bring up the GUI. Pressing F12, VICE came back telling me "Unknown Key".

I'm guessing this has something to do with keymapping???
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Problem with Ultra Slim Keyboard

Tue May 17, 2016 8:51 pm

Is the problem with F11 and F12, or all function keys? Does it make a difference if you are holding the blue Fn key?

Use your spare keyboard to switch to text mode (Ctrl+Alt+F2) and log in and run "showkey". Does the BT keyboard produce different key codes than the wired one, or no codes at all? If none, does "dmesg" show any errors about unknown keys?

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Tue May 17, 2016 10:38 pm

I shall let you know! :D

I tested the keyboard in Windows 7 and the keyboard works fine. So I'm guessing Linux isn't seeing the keyboard properly.
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Sun Jun 05, 2016 10:45 am

Finally I'm back with keymaps and I'm totally confused by the results

BT Slim Line Keymap vs USB Keyboard
F1->F12

224 - 59
225 - 60
120 - 61
204 - 62
229 - 63
230 - 64
165 - 65
164 - 66
163 - 67
113 - 68
114 - 87
115 - 88

Any advice on this would be really appreciated
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Problem with Ultra Slim Keyboard

Sun Jun 05, 2016 1:52 pm

59…88 are the proper Linux codes for F1…F12, and the higher numbers are various multimedia codes, as given in /usr/include/linux/input.h:

Code: Select all

#define KEY_BRIGHTNESSDOWN      224
#define KEY_BRIGHTNESSUP        225
#define KEY_SCALE               120     /* AL Compiz Scale (Expose) */
#define KEY_DASHBOARD           204     /* AL Dashboard */
#define KEY_KBDILLUMDOWN        229
#define KEY_KBDILLUMUP          230
#define KEY_PREVIOUSSONG        165
#define KEY_PLAYPAUSE           164
#define KEY_NEXTSONG            163
#define KEY_MUTE                113
#define KEY_VOLUMEDOWN          114
#define KEY_VOLUMEUP            115
Those do not appear to be in the same order as the blue symbols actually printed on the keys in the Pimoroni image, which is odd. Does your keyboard match the picture? They describe the item as UK layout, but the image shows @ on Shift+2, which is US.

Do you get the same codes with and without the blue Fn modifier key? Some Apple keyboards do generate multimedia events by default, and require the shift to get numbered functions.

The fact that Linux at least sees unique codes for each key means you could generate a completely custom layout if necessary. I am not aware of an easy guide for that.

Some things that may or may not be relevant: Are you using a BT dongle that came with the keyboard, a separate dongle, or the built-in bluetooth of a Pi3? Can you post the contents of the file /etc/default/keyboard.

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Mon Jun 06, 2016 9:34 am

I'm using a BT 4.0 dongle bought from Maplins for £12.

I'll try showkey, while pressing down the fn key.
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Wed Jun 08, 2016 10:13 am

Okay, here we go with the latest in this crazy keyboard. Pressing down the FN key while pressing the Function keys results in the following

F1=240
F2=240
F3=217
F4=155
F5=150
F6=139
F7=165
F8=164
F9=163
F10=113
F11=114
F12=115
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Thu Jun 09, 2016 10:08 am

Anyone have a clue what's going on or how I can remap the keys so they work?
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Fri Jun 10, 2016 10:42 pm

I truly hope I didn't write down those key maps for nothing, after someone asked me for them.
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Wed Jun 15, 2016 8:40 am

Hey guys, I'm still stuck with this and really needing some advice.

Thanks
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Problem with Ultra Slim Keyboard

Wed Jun 15, 2016 4:00 pm

Haemogoblin wrote:I truly hope I didn't write down those key maps for nothing, after someone asked me for them.
I did not actually ask you to write down the codes, but to check whether Linux was seeing the wrong ones or none at all.

The list of codes was very interesting, however. It basically matches the order of the multimedia functions on an Apple compact keyboard (http://www.thebookyard.com/images/661-4905.gif), which is completely different from the order of the blue legends shown in the image on the Pimoroni site (https://shop.pimoroni.com/products/ultr ... h-keyboard). I asked whether your keyboard markings match the Pimoroni image, and particularly whether it is actually UK or US layout in regard to Shift+2, but you did not answer.

I had to ask twice whether Fn made a difference. You never posted the contents of /etc/default/keyboard as I suggested.

Unfortunately not only do I not have the keyboard in question, but I have never used any BT or Apple keyboard. I am not really sure how either of them may differ from standard USB HID. Since the keyboard works for you in Windows, I suspect there is a "proper" solution, maybe related to /sys/module/hid_apple/parameters/fnmode, but I have little confidence in my ability to talk you through finding that.

Xorg uses keycodes that are eight greater than those in Linux. If VICE is an X client, then does F12 work after you issue the command:

Code: Select all

xmodmap -e "keycode $((115+8)) = F12"

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Wed Jul 13, 2016 4:24 pm

You've actually raised a good point. I have a BT Apple keyboard which might be worth checking against this keyboard.

Sorry if I was a bit short, but as you can imagine. Having only half a working keyboard and not even the faintest hint to a fix, is utterly frustrating. I'd hoped posting on the forum would have garnered me some sort of solution. But you've been the only person to reply. For that I'm really grateful :-) I just can't help think I'd have done better posting on a Linux forum.
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

Haemogoblin
Posts: 182
Joined: Mon Sep 24, 2012 12:13 pm
Location: United Kingdom
Contact: Website

Re: Problem with Ultra Slim Keyboard

Sat Jul 23, 2016 11:33 am

etc/default/keyboard

Is an empty file
Blackadder: Right Baldrick, let's try again, shall we? This is called adding. If I have two beans, and then I add two more, what do I have?
Baldrick: Some beans

User avatar
DougieLawson
Posts: 36130
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Problem with Ultra Slim Keyboard

Sat Jul 23, 2016 3:29 pm

How about /etc/default/keyboard with that all important forward slash.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Problem with Ultra Slim Keyboard

Sat Jul 23, 2016 7:39 pm

Did that xmodmap command help with F12, or not?

Or if VICE is not an X client, the equivalent console-mode command would be:

Code: Select all

echo "keycode 115 = F12" |sudo loadkeys

Return to “Troubleshooting”