Apple wireless keyboard linux

How to Setup Apple Wireless Keyboard on Ubuntu

How to pair Apple Wireless keyboard with Ubuntu PC?

When being paired through Ubuntu’s bluetooth GUI app, Apple Wireless keyboard will probably play dead, even if bluetooth manager says that its been successful connected. The other possible scenario is that it will prompt for pairing key but typing on a keyboard does nothing. Even if you manage to type in the pairing key, keyboard will probably remain dead after that. If somehow you manage to connect and the keyboard works, it will disconnect when Capslock is pressed.

Solution

Solution is simple… Don’t use bluetooth GUI utility! As it tends to be with many other GUI Linux apps, Bluetooth manager has some glitches and bugs, compared to old fashioned console commands. Although other BT devices might work fine when connected via GUI utility, Apple keyboards will probably not, so you’ll have to connect it through Linux console.

Follow the steps below by using another working keyboard:

1 Open up a new Ubuntu console window. Make sure that the Bluetooth module on your PC is turned on. At this moment, Apple keyboard MUST BE turned off (remove/return batteries cap to be sure).

2 Enter and execute sudo bluetoothctl command. If being asked for password, enter your sudo password. You should now see [bluetooth]# at the beginning of line, which means that you successful entered Ubuntu Bluetooth Console Utility.

3 Execute the following commands, one by one:

4 This is the moment to turn on the keyboard. Press power button and KEEP IT PRESSED all the time (until being told to stop). If you find difficult to do the following steps while keeping keyboard button pressed, ask someone else to do it for you.

5 Enter and execute scan on command and wait for your keyboard being listed, along with its mac address which should look like this: 28:C6:3F:96:CE:12 (we’ll use this address as a placeholder during the rest of this tutorial)

6 Enter and execute following commands:

7 Message saying “Attempting to pair with 28:C6:3F:96:CE:12” should come up, and after couple of seconds it will give you a 6 number PIN code. RELEASE THE POWER button and enter the provided PIN using Apple keyboard. Do not pay attention if entered pin isn’t showing on the screen, just press ENTER after entering the PIN. After couple of seconds, you should get the message saying “Pairing successful”.

8 At this moment, your Apple keyboard should be working fine. Still it happens sometimes that it enters num-lock mode, which will make most of letter keys do nothing, while some of them will type numbers. To turn off this, hold down Fn key and press F6 twice.

Читайте также:  Mac mini linux server

Your Wireless Apple Keyboard is working now and you can use it as any other PC keyboard. All settings will be saved after reboot or login/logout. Keys works as intended, except that you’ll use CMD key instead of WIN (meta) key. Still, there’s a limitation in terms of functionality compared to PC keyboards, and it is the lack of DEL key (delete forward). BUT… There’s a pretty useless EJECT key on the upper right corner, which you can easily remap to be used as DEL! Tutorial below…

How to map Apple keyboard’s EJECT key to DELETE on Ubuntu PC?

1 Open up a new Ubuntu console window.

2 Enter and execute sudo nano ~/.Xmodmap command. If being asked for password, enter your sudo password. You should now see the content of .Xmodmap file, opened in Nano console editor. The file will probably be empty, so enter following lines (or append to the end, if there’s already something there):

3 Press CTRL+X, then Y key for confirmation and finally ENTER to exit Nano.

NOTE: this tutorial was tested with Apple A1314 wireless keyboard and Kubuntu KDE desktop suite. It might or might not work for other keyboard/OS versions.

Источник

Thread: HOWTO: Apple Wireless Keyboard (Bluetooth)

naag is offlineFirst Cup of Ubuntu

HOWTO: Apple Wireless Keyboard (Bluetooth)

This guide was previously written for Ubuntu 6.06. However, these instructions have been updated to work on Ubuntu 7.04 (Feisty Fawn).

Changes made:
Replaced «hidd —search» by «hidd —connect BD_ADDR»
Replaced «/etc/init.d/bluez-utils» by «/etc/init.d/bluetooth»
Added «HIDD_ENABLED=1»
Added package «bluetooth» and «bluez-gnome»

I lately had some trouble using my Apple Wireless Keyboard with Ubuntu 7.04 so I’d like to share my experiences with you. So this is a small guide on pairing your Apple Wireless Keyboard with your Bluetooth Dongle of choice. Okay, so let’s get started.

First of all, install the package bluez-gnome:

user@ubuntu:~$ sudo apt-get install bluetooth bluez-gnome

Restart your desktop session by logging out and logging in again. This will automatically start the bluetooth applet which will help you enter the PIN during the bluetooth pairing process.

Now we need to find out the Bluetooth Hardware Device Address (BD_ADDR) of our Apple Keyboard. Unfortunately, this is not written anywhere on the keyboard itself. So we need to turn on the keyboard (or restart it) using the switch on the bottom and run the following command:

user@ubuntu:~$ hcitool scan Scanning . BD_ADDR Apple Wireless Keyboard user@ubuntu:~$

Okay, there we got the BD_ADDR and the name of our device.

This seems to be the crucial piece of the bluetooth puzzle!

Now copy that BD_ADDR to your clipboard and edit the file /etc/bluetooth/hcid.conf to enable authentication and encryption for this very BD_ADDR.

user@ubuntu:~$ sudo gedit /etc/bluetooth/hcid.conf

Enter the following stanza at the end of the file, replacing BD_ADDR with your BD_ADDR from the clipboard:

When you’re finished, save the file and close gedit.

Читайте также:  Skyrim on linux wine

We’re now going to enable HID-support by default:

user@ubuntu:~$ sudo gedit /etc/default/bluetooth

Change «HIDD_ENABLED=1» to «HIDD_ENABLED=0». Take care that using this how-to you do not need any «—connect BD_ADDR» parameters to hidd. So you can remove them from HIDD_OPTIONS. «HIDD_OPTIONS=’—master —server'» is just fine.

Save the file, close gedit and restart the Bluetooth subsystem using the following command:

user@ubuntu:~$ sudo /etc/init.d/bluetooth restart * Restarting Bluetooth services. [ ok ]

Notice that this will terminate any active bluetooth connections. However, reconnecting should not be a problem

Finally, we’re ready to do the actual pairing. Restart the keyboard again using the switch on the bottom to make it discoverable. Do not hit any keys on your Apple Keyboard unless this tutorial says so. It might cause all sorts of strange trouble during the pairing procedure. Okay, so, right after restarting the keyboard, run the following command (replacing BD_ADDR by the actual address, of course ):

user@ubuntu:~$ sudo hidd --connect BD_ADDR user@ubuntu:~$

Ubuntu will now try to connect to the keyboard without showing any progress bar or other output. It will just sit there and wait. Okay, enter a PIN consisting of 4 digits and hit the enter key (both on your Apple Keyboard). Right after hitting enter, a notification window should pop up on your desktop asking you for the PIN you just entered. Enter it. «hidd» should finish without further outputs. You should now be set up.

I hope that this will be useful to some people out there. Feel free to correct me or ask questions

glug101 is offlineGee! These Aren’t Roasted!

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

Thank you very much for this. I have to tell you that I was slightly disappointed that my bluetooth keyboard didn’t ‘just work’ after I updated to Dapper, but then I was really disappointed when following the same steps that got it working under Breezy didn’t work. While I don’t remember the precise steps I took in Breezy, I do remember that they were way simpler than this.

Anyhow, thanks again for the great howto. This worked perfectly (after I had properly charged batteries in the keyboard). Now all I have to do is find a bluetooth mouse that I can afford, There must be a grand total of 3 mice that are bluetooth and are not made by Apple. (Like the keyboards, hate the mice.)

nakko is offlineSpilled the Beans

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

I followed these instructions to the T, but if I turn my keyboard off, it is never automatically recognized again.

Every time I want to use it, I have to manually (and with another keyboard) type «sudo hidd —search».

What might I be doing wrong?

oswaldkelso is offlineQuad Shot of Ubuntu

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

Okay, now we’re ready to do the actual pairing. Restart the keyboard again using the switch on the bottom. Do not hit any buttons on your Apple Keyboard unless this tutorial says so. It might cause all sorts of strange trouble during the pairing procedure. Okay, so, right after restarting the keyboard, execute the following command:

user@ubuntu:~$ sudo hidd --search Searching . Connecting to device BD_ADDR user@ubuntu:~$

As soon as it prints out «Connecting to device BD_ADDR», you should enter a PIN consisting of 4 digits and hit the Return key (on your Apple Keyboard). Right after hitting Return, a window should pop up on your computer asking you for the PIN you just entered. Enter it. You should now be set up.

Читайте также:  Встроенный hex редактор linux

I hope that this will be useful to some people out there. Feel free to correct me or ask questions [/QUOTE]

«Searching .
Connecting to device 00:0A:95:3F:75:17
Can’t get device information: File descriptor in bad state»

Any help received with thanks. It would really be nice if we could make a sticky out of this as I like many I suspect are using cheapo usb keyboards,mice and headsets with our good gear sat in a cupboard.

I think there is a bluez file that stores the code for your seperate bluetooth devices. I seem to remember editing it a while back for my phone or headset but I knew the codes to enter.

skindog is offlineFirst Cup of Ubuntu

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

What a great howto — it worked flawlessly the first time! Thanks so much for the info.

However, similar to nakko above, I’m struggling to understand how to make the pairing automatic in the case of either the keyboard or computer falling asleep or restarting. Is it simply a matter of putting the «hidd —search» command in a startup script somewhere?

Any help is much appreciated.

morphet is offline5 Cups of Ubuntu

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

Or you can just uninstall bluez-utils. It worked like an instant charm for me. System -> Administration -> Synaptic Package Manager.

Search for bluez, uncheck (check for removal) bluez-utils. Apply.

skindog is offlineFirst Cup of Ubuntu

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

As it turns out, I found the information I needed here: https://help.ubuntu.com/community/BluetoothSetup Now my Apple Wireless Keyboard will work after reboot, and also wake the machine up from sleep. Brilliant! Now if I could just figure out how to get the Apple Wireless Mighty Mouse input to be interpreted properly.

zalberico is offlineA Carafe of Ubuntu

WinkRe: HOWTO: Apple Wireless Keyboard (Bluetooth)

Thanks morphet!
Removing the bluez utils mad both the keyboard and mouse pair instantaneously
What an easy fix!

Graybeard is offline5 Cups of Ubuntu

Re: HOWTO: Apple Wireless Keyboard (Bluetooth)

This thread gives me hope. I don’t have a bluetooth keyboard but I’ve been hoping that there’s a way to get my usb rf keyboard/mouse to work on Ubuntu. (It works fine on a windows box and I like it.) The Ubuntu box recognizes it as shown by the following info in the Device Manager:

Device Manager «Advanced» tab gives the following:

button.has_state Bool false
button.type strlist
info.addons list hald-addon-keyboard
info.capabilities list input, input.keyboard, button
info.category strlist input
info.parent strlist /org/freedesktop/Hal/devices/usb_device_195d_7777_noserial_if1
info.product strlist Itron Powerful Receiver
info.udi strlist /org/freedesktop/Hal/devices/usb_device_195d_7777_noserial_if1_logical_input
input.device strlist /dev/input/event3
input.physical_device strlist /org/freedesktop/Hal/devices/usb_device_195d_7777_noserial_if1
input.product strlist Itron Powerful Receiver
linux.device_file strlist /dev/input/event3
linux.hotplug_type int 2(0x2)
linux.subsystem strlist input
linux.sysfs_path strlist /sys/class/input/input3/event3

Dell 4550 with Pentium-4 2.66 GHz running Ubuntu 6.06 networked to a custom box with ASRock 775i65GV mobo and Core2-duo cpu running WinXP for GIS work.

Источник

Оцените статью
Adblock
detector