Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

keyboard filter


  • Please log in to reply
48 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

You meant "I did it using Emule 1 month ago"


yup, sorry, my english again.

Just go download it using Emule if you don't have subscription. Or wait until they set it free, witch they do once I year, for several days.
Posted Image

Yunkun Lee
  • Guests
  • Last active:
  • Joined: --
To GeomanNL:
I'm a new learner. Could you send me a full version source of kbfiltr_ext.zip .

My email: [email protected] or [email protected]
or [email protected]

thanks .
My msn: [email protected]
May i know your msn?

Kana
  • Guests
  • Last active:
  • Joined: --
Hi Geoman,

thanks for this work, I already saw myself spending hours and hours on doing my own driver until I discovered your work ;)
I've got a problem though: My Win XP doesn't recognize my external USB keyboard if I try to give it your extended filter driver.
The HW String is HID\VID_05A4&PID_9862&MI_00\8&3957B92D&0&0000, and I've been trying to fiddle around with both the kbfiltr.inf and keyboard.inf for hours now to enter this missing string in there, but to no avail (I go Driver->New Driver->Don't search->Install from list->Don't Search->Browse; this works for my standard PS2 keyboard ACPI\PNP0303\3&13C0B0C5&0, but not for the USB one).

Do you have a hint?

Thanks, Kana

composition4
  • Members
  • 7 posts
  • Last active: Jan 25 2007 12:17 AM
  • Joined: 20 Dec 2006
Yeah I tried this, but I believe it's because the driver is written for a PS/2 keyboard, not a USB. One quick solution is to get a USB to PS/2 adapter (that's what I did)

To the writer of these drivers: Thanks a heap, I needed a driver so I could use a separate numpad as a "hotkey" keyboard without affecting my main keyboard... and this driver worked perfectly!

rbanks801
  • Guests
  • Last active:
  • Joined: --
Okay, so what I want to see is someone do this with two USB keyboards. Of course they would have to be different brands or models with .inf files specified for each. Is this even possible? Let's hear what you think.

kilven
  • Guests
  • Last active:
  • Joined: --
Hello every one ,I'm New to AutoHotKey ,I need a piece code to inject keys to directx game ,sendinput now work ,So I think you can help me to make a keyboard filter driver to do this.thanks very much.

  • Guests
  • Last active:
  • Joined: --
I would like to know how I can use the kbfiltr to remap keys on driver level, basically is there a way to edit the kbfiltr file Geoman posted in is first post and change i so that a key can be remapped. This will allow us to use even more keys.

joelhewitt
  • Guests
  • Last active:
  • Joined: --
I am toying around with a dvorak keyboard, but I still use the qwerty. So I have a regular USB keyboard, and a PS/2 with the keys reorganized to make a dvorak. So using the starting kbfiltr in the WINDDK and the samples posted earlier I have two different layouts at the same time. The driver filters the PS/2 and remaps it to dvorak, the code is as follows:
VOID
KbFilter_ServiceCallback(
    IN PDEVICE_OBJECT DeviceObject,
    IN PKEYBOARD_INPUT_DATA InputDataStart,
    IN PKEYBOARD_INPUT_DATA InputDataEnd,
    IN OUT PULONG InputDataConsumed
    )
/*++

Routine Description:

    Called when there are keyboard packets to report to the RIT.  You can do 
    anything you like to the packets.  For instance:
    
    o Drop a packet altogether
    o Mutate the contents of a packet 
    o Insert packets into the stream 
                    
Arguments:

    DeviceObject - Context passed during the connect IOCTL
    
    InputDataStart - First packet to be reported
    
    InputDataEnd - One past the last packet to be reported.  Total number of
                   packets is equal to InputDataEnd - InputDataStart
    
    InputDataConsumed - Set to the total number of packets consumed by the RIT
                        (via the function pointer we replaced in the connect
                        IOCTL)

Return Value:

    Status is returned.

*/
{
    PDEVICE_EXTENSION   devExt;

    devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

	switch (InputDataStart->MakeCode)
	{
	case 0x01e:	//a
		InputDataStart->MakeCode = 0x01e; //a
		break;
	case 0x030:	//b
		InputDataStart->MakeCode = 0x02d; //x
		break;
	case 0x02e:	//c
		InputDataStart->MakeCode = 0x024; //j
		break;
	case 0x020:	//d
		InputDataStart->MakeCode = 0x012; //e
		break;
	case 0x012:	//e
		InputDataStart->MakeCode = 0x034; //>
		break;
	case 0x021:	//f
		InputDataStart->MakeCode = 0x016; //u
		break;
	case 0x022:	//g
		InputDataStart->MakeCode = 0x017; //i
		break;
	case 0x023:	//h
		InputDataStart->MakeCode = 0x020; //d
		break;
	case 0x017:	//i
		InputDataStart->MakeCode = 0x02e; //c
		break;
	case 0x024:	//j
		InputDataStart->MakeCode = 0x023; //h
		break;
	case 0x025:	//k
		InputDataStart->MakeCode = 0x014; //t
		break;
	case 0x026:	//l
		InputDataStart->MakeCode = 0x031; //n
		break;
	case 0x032:	//m
		InputDataStart->MakeCode = 0x032; //m
		break;
	case 0x031:	//n
		InputDataStart->MakeCode = 0x030; //b
		break;
	case 0x018:	//o
		InputDataStart->MakeCode = 0x013; //r
		break;
	case 0x019:	//p
		InputDataStart->MakeCode = 0x026; //l
		break;
	case 0x010:	//q
		InputDataStart->MakeCode = 0x028; //'
		break;
	case 0x013:	//r
		InputDataStart->MakeCode = 0x019; //p
		break;
	case 0x01f:	//s
		InputDataStart->MakeCode = 0x018; //o
		break;
	case 0x014:	//t
		InputDataStart->MakeCode = 0x015; //y
		break;
	case 0x016:	//u
		InputDataStart->MakeCode = 0x022; //g
		break;
	case 0x02f:	//v
		InputDataStart->MakeCode = 0x025; //k
		break;
	case 0x011:	//w
		InputDataStart->MakeCode = 0x033; //<
		break;
	case 0x02d:	//x
		InputDataStart->MakeCode = 0x010; //q
		break;
	case 0x015:	//y
		InputDataStart->MakeCode = 0x021; //f
		break;
	case 0x02c:	//z
		InputDataStart->MakeCode = 0x027; //;
		break;
	case 0x033:	//<
		InputDataStart->MakeCode = 0x011; //w
		break;
	case 0x034:	//>
		InputDataStart->MakeCode = 0x02f; //v
		break;
	case 0x035:	///
		InputDataStart->MakeCode = 0x02c; //z
		break;
	case 0x027:	//;
		InputDataStart->MakeCode = 0x01f; //s
		break;
	case 0x028:	//'
		InputDataStart->MakeCode = 0x00c; //-
		break;
	case 0x01a:	//[
		InputDataStart->MakeCode = 0x035; ///
		break;
	case 0x01b:	//]
		InputDataStart->MakeCode = 0x00d; //=
		break;
	case 0x00c:	//-
		InputDataStart->MakeCode = 0x01a; //[
		break;
	case 0x00d:	//=
		InputDataStart->MakeCode = 0x01b; //]
		break;
		}
	
    (*(PSERVICE_CALLBACK_ROUTINE) devExt->UpperConnectData.ClassService)(
        devExt->UpperConnectData.ClassDeviceObject,
        InputDataStart,
        InputDataEnd,
        InputDataConsumed);
}
[Moderator's note: Added code tags...]

  • Guests
  • Last active:
  • Joined: --
I have a PS2 keyboard/MIDI device that I need to leave alone, and a USB keyboard that I need to remap. Can this code be made to work in the reverse? If so, can anyone explain how to install this to work with AHK?

Thanks!

Nyo
  • Members
  • 1 posts
  • Last active: May 18 2008 11:20 PM
  • Joined: 17 May 2008
Actually, the filter drivers GeomanNL posted seem to work fine with a USB keyboard (as I would expect, since it's filter driver loading ajecently to the keyboard class driver in the driver stack, which is shared between the USB and PS/2 keyboards.) Also, I made it work with 2 USB keyboards, remapping just one of them.

I had a USB keyboard and a gamepad, both if which came with no specific drivers and were running with the same standard USB keyboard drivers, but I wanted to map them separately. The trick is to load the at the right insertion point in the driver stack. I modified the .inf file for GeomanNL's kbfiltr_ext to do this. I changed it so that it would load for the most specific hardware id for the keyboard I wanted to remap (the device id). This is first entry for listed under Hardware Ids for the device in device manager. For example, my gamepad had HID_04f3&Pid_0103&Rev_0105&MI00 (and the Logitech keyboard a different id).

I then changed the line

%DDK_Ex% = kbfiltr, *PNP0BAAD

into

%DDK_Ex% = kbfiltr, HID\VID_04f3&Pid_0103&Rev_0105&MI_00

in the kbfiltr.inf file, and replaced all references to STANDARD_Inst with HID_Keyboard_Inst.

Now the driver would load for the gamepad, and everything worked fine. (I would then use the extended scancodes in my ahk-script to respond to the keypad).

I hope this helps, if anyone is still interested in a solution to this.

brasshopper
  • Members
  • 2 posts
  • Last active: Aug 06 2008 02:15 AM
  • Joined: 06 Aug 2008
I read through a bunch of these things, and I have a couple of questions, one simple, a couple less so:

1. Does this driver work on Vista?

2. This gives you the 100% deterministic abilty to tell which keyboard any keystroke came from - with a fair amount of complexity - all keys from that keyboard are remapped and need to be reverse translated if they are to be used normally, as I understand it. Suppose I was willing to accept a small bit of non-deterministic operation. If a thing in the stack of this class of hardware device was simply able to set a flag (not associated with the keystroke, but a global flag) - and it contained an indicator of which keyboard the last input was typed on, then it could be tested later (with a small command that would return a sequence number, say). Yes, if you were typing on both keyboards at the same time, some strokes could/would be thought to come from the wrong keyboard. For a single typist who was trying to use keyboards alternately, I believe that this schem would work fine. You could easily test this in an ahk script - an it would mean normal processing for all keys you did not want to test to differientiate, while keys you did want to differientate could be checked as part of the hotkey processing.

A cuteness would be to have a tray gadget that changed colors based on which keyboard was "hot" - which keyboard was last typed on.

3. There is support for remapping keys in Windows - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout. This is not nearly as nice as ahk, but it is "under" the ahk level, as I understant it - these translations are applied before ahk (or anything else) gets the scan codes. Currently, as I understand it, all translations are applied to all keystrokes, so if you turn off caps lock on one keyboard you turn it off on all keyboards. Were it possible to have multiple maps and to apply the translation to each keyboard independently, then, again, the keys you wanted to differientate could be translated on one keyboard. I guess that the answer is to match hardware types to keyboard translation tables.

I'm not a device driver programmer in Windows. I'd undertake writing an app that would alter the registry to modify the translation tables. Any interest in this?

GaaaIe
  • Guests
  • Last active:
  • Joined: --
I tested this keyboard filter and it is working well.

I wanted to setting this filter under vista sp1 64bit os , but I failed.

I go too, I go Driver->New Driver->Don't search->Install from list->Don't Search->Browse,

but this driver is not installed. What is the problem?

Is there anybody who installs it and uses properly under the vista 64bit os?

Could you tell a tip to me ?

ab/user
  • Guests
  • Last active:
  • Joined: --
I work in network control center. I have several applications I use. One in particular is Absolute Telnet. I have keymapped all my commands for various routers like cisco, marconi, alcatel-lucent and juniper. I ran out of keys. When I type my trouble-shooting findings, my keymaps get in the way outputting strings of commands. I would like my second keyboard to control only the telnet session along with the keymaps. I want the first keyboard to control the normal Windows applications and the rest of the monitoring tools in a normal way. Both keyboards are USB. Any Ideas?

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Not easy. Check these out:
http://www.autohotke...opic.php?t=6367
http://www.autohotke...p=147617#147617
http://www.autohotke.../topic7135.html
or search for DirectInput in MSDN.

Yorick
  • Guests
  • Last active:
  • Joined: --
All you need has been done here http://www.oblita.com/hooking-part1. Soon I'll deliver an updated library/driver with new samples I've already done.