geekhack

geekhack Community => Keyboards => Topic started by: azhdar on Fri, 06 November 2015, 14:40:18

Title: Disabling physical keyboard of Laptop
Post by: azhdar on Fri, 06 November 2015, 14:40:18
Beside opening the laptop and unplugging the keyboard. What are easy way to do it?

Autohotkey script? Software ?
Title: Re: Disabling physical keyboard of Laptop
Post by: inanis on Fri, 06 November 2015, 14:41:01
The BIOS perhaps?
Title: Re: Disabling physical keyboard of Laptop
Post by: weehooherod on Fri, 06 November 2015, 14:55:41
What OS are you using? I use this on my mac to disable the built in keyboard.

Code: [Select]
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Fri, 06 November 2015, 14:57:07
The BIOS perhaps?

iirc I couldn't on this laptop.

What OS are you using? I use this on my mac to disable the built in keyboard.

Code: [Select]
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext

I'll re install this laptop with either W7 or some linux, not sure yet.
Title: Re: Disabling physical keyboard of Laptop
Post by: weehooherod on Fri, 06 November 2015, 15:00:25
The BIOS perhaps?

iirc I couldn't on this laptop.

What OS are you using? I use this on my mac to disable the built in keyboard.

Code: [Select]
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext

I'll re install this laptop with either W7 or some linux, not sure yet.

I'm not sure about Windows but with Linux there are a myriad of ways to do this. Find some solution on a forum somewhere and throw it in whatever startup script your Linux distribution uses if you'd like it to be disabled when you turn it on.
Title: Re: Disabling physical keyboard of Laptop
Post by: rm-rf on Fri, 06 November 2015, 15:01:34
(http://41.media.tumblr.com/8d51b4fa31bb91aabf428dd44d8fa17e/tumblr_nldk2nbKDd1s05pn4o1_1280.jpg)
Title: Re: Disabling physical keyboard of Laptop
Post by: Flossed on Fri, 06 November 2015, 16:32:46
Show Image
(http://41.media.tumblr.com/8d51b4fa31bb91aabf428dd44d8fa17e/tumblr_nldk2nbKDd1s05pn4o1_1280.jpg)


Proceed with caution using this method, you might damage some other components.  :thumb:
Title: Re: Disabling physical keyboard of Laptop
Post by: rm-rf on Fri, 06 November 2015, 16:41:04
depending on what kind of laptop you've got, some are fairly easy to just unplug the keyboard on.
but it also may be possible via bios.
shame it isn't as easy to disable like the track-pad is.
Title: Re: Disabling physical keyboard of Laptop
Post by: Touch_It on Fri, 06 November 2015, 16:47:10
maybe you can disable the keyboard driver?
Title: Re: Disabling physical keyboard of Laptop
Post by: n on Fri, 06 November 2015, 20:38:33
Google will find many examples for whatever Linux distro you pick. For Windows I use DevCon, but you could get by with a ghetto AutoHotKey script along these lines:

Disable Device (WinKey + X example)

#x::
    Run, devmgmt.msc                                     ; Open Device Manager
    Sleep 1000                                           ; Wait for Device Manager to load, adjust as preferred
    WinActivate, Device Manager                          ; Set focus to Device Manager
    Sleep 100
    ControlClick, SysTreeView321, Device Manager,,,, NA  ; Simulate click on Device Manager (without this, no keyboard input is accepted)
    Sleep 100
    Send {Tab}                                           ; Move focus to the device ListView control
    Sleep 100
    Send {Down}{Down}{Down}{Right}{Down}{AppsKey}d       ; Random example; adjust the number of {Down} commands to get to the dev family
                                                         ; you want, the right arrow to expand devices, and down again to set focus on a
                                                         ; particular device. Then hit the menu key to open the context menu and the D
                                                         ; key to disable the selected device.
    Sleep 100
    WinClose, Device Manager                             ; Close Device Manager
Return


Note that when a device is disabled, its device family is automatically expanded in the device manager. So, enabling a device is a little different in the 10th line:

Enable Device (WinKey + Z example)

#z::
    Run, devmgmt.msc                                     ; Open Device Manager
    Sleep 1000                                           ; Wait for Device Manager to load, adjust as preferred
    WinActivate, Device Manager                          ; Set focus to Device Manager
    Sleep 100
    ControlClick, SysTreeView321, Device Manager,,,, NA  ; Simulate click on Device Manager (without this, no keyboard input is accepted)
    Sleep 100
    Send {Tab}                                           ; Move focus to the device ListView control
    Sleep 100
    Send {Down}{Down}{Down}{Down}{AppsKey}e              ; No right-arrow as the dev family is already expanded; E for Enable instead of D
    Sleep 100
    WinClose, Device Manager                             ; Close Device Manager
Return


NOTE: If you're using non-English Windows, your shortcut keys for _E_nable and _D_isable may differ -- change as appropriate.

DevCon is much cleaner and easier though. I've attached the x86 and x64 versions (incl. checksums; x86 scan here (https://www.metascan-online.com/#!/results/file/6598c34ae99041fc9790167d6ec9f153/regular) / x64 scan here (https://www.metascan-online.com/#!/results/file/df3fd9c54cb44a3fa456b469f509f99a/regular)) to this post; follow these steps:
This is the DevCon syntax to remove a device (include the double-quotes):

devcon.exe remove "HARDWARE_ID_HERE"

Repeat for other keyboard devices if needed; the internal keyboard will now be disabled immediately and completely. To restore the keyboard, use this command:

devcon.exe rescan

You can trigger these commands from a hidden command window in AHK, e.g. WinKey + 0 example:

#0::Run, C:\Windows\System32\devcon.exe remove "HID\VID_0B05&PID_17E0&REV_0249&MI_00", , Hide

HTH.
Title: Re: Disabling physical keyboard of Laptop
Post by: grav3serker on Sat, 07 November 2015, 00:46:05
Show Image
(http://41.media.tumblr.com/8d51b4fa31bb91aabf428dd44d8fa17e/tumblr_nldk2nbKDd1s05pn4o1_1280.jpg)

This made me laugh. So literal, so metal :thumb:
Title: Re: Disabling physical keyboard of Laptop
Post by: priyadi on Sat, 07 November 2015, 02:36:04
Under Linux/X11 , I'm using this script to toggle keyboard on and off:

Code: [Select]
#!/bin/sh

KEYBOARD="AT Translated Set 2 keyboard"
MASTER="Virtual core keyboard"

if xinput list --short "$KEYBOARD" | grep -q 'floating slave' ; then
        xinput reattach "$KEYBOARD" "$MASTER"
else
        xinput float "$KEYBOARD"
fi

Then I bind the script to the lock button. With my Thinkpad the lock button (Fn-F3) is on separate logical keyboard, so it is still working after the main keyboard is disabled.
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Sat, 07 November 2015, 03:16:42
Thanks for all the answers guys.
Title: Re: Disabling physical keyboard of Laptop
Post by: heedpantsnow on Sat, 07 November 2015, 13:51:34
Wow that's some good info.  I might need to save that AHK script for future use...
Title: Re: Disabling physical keyboard of Laptop
Post by: SamirD on Sun, 08 November 2015, 01:30:20
If the laptop has a dedicated ps2 port, a lot of laptops back in the day would automatically disable the built-in keyboard.
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Thu, 19 November 2015, 10:08:39
Bumping because I can't manage to disable it on this W7 laptop. devcon seems to have issue with W7 and this stupid laptop doesn't allow to disable it :

(http://i.imgur.com/FF0Wk0B.png)
Title: Re: Disabling physical keyboard of Laptop
Post by: dan002 on Thu, 19 November 2015, 11:31:57
Why do you need to disable? Is it because the keyboard is sitting on top of the laptops keyboard, and randomly mashing keys?
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Thu, 19 November 2015, 11:37:26
Why do you need to disable? Is it because the keyboard is sitting on top of the laptops keyboard, and randomly mashing keys?

yes & yes.
Title: Re: Disabling physical keyboard of Laptop
Post by: asdfjkl36 on Thu, 19 November 2015, 12:16:03
Yea I haven't put much effort into finding this out either
All I know is that uninstalling the drivers won't work. It still registers the keyboard perfectly.
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Thu, 19 November 2015, 12:19:20
Yea I haven't put much effort into finding this out either
All I know is that uninstalling the drivers won't work. It still registers the keyboard perfectly.

I tried something like that, you have to disable auto installing of drivers otherwise it just get reinstalled each time.
But it wasn't a convenient as it was also preventing other devices from being auto installed, like usb keys or mices.

Title: Re: Disabling physical keyboard of Laptop
Post by: dan002 on Thu, 19 November 2015, 14:11:41
You could build something like this...thing...

A piece of clipboard with some rubber feat because I was concerned of damaging the laptop's keys.
It protects the keys and prevents unwanted mashing.

[attachimg=1]
Side view of the thing
[attachimg=2]
Top view of the thing
Title: Re: Disabling physical keyboard of Laptop
Post by: azhdar on Thu, 19 November 2015, 14:14:11
Didn't even think of that, that's actually a good idea.
Title: Re: Disabling physical keyboard of Laptop
Post by: MagicSauce on Thu, 19 November 2015, 14:14:59
You could build something like this...thing...

A piece of clipboard with some rubber feat because I was concerned of damaging the laptop's keys.
It protects the keys and prevents unwanted mashing.

(Attachment Link)
Side view of the thing
(Attachment Link)
Top view of the thing

Interesting, I was thinking of something along these lines as well.  I want to try to make a simple one out of acrylic.
Rubber feet is definitely a good idea so the thing doesn't slide around.