 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Fri Jul 07, 2006 9:32 am Post subject: |
|
|
| Quote: | | 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. _________________
 |
|
| Back to top |
|
 |
Yunkun Lee Guest
|
|
| Back to top |
|
 |
Kana Guest
|
Posted: Wed Jan 24, 2007 10:56 am Post subject: Driver Install doesn't work |
|
|
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 |
|
| Back to top |
|
 |
composition4
Joined: 20 Dec 2006 Posts: 7
|
Posted: Thu Jan 25, 2007 1:17 am Post subject: |
|
|
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! |
|
| Back to top |
|
 |
rbanks801 Guest
|
Posted: Mon Jan 29, 2007 4:21 am Post subject: How about with a USB Keyboard |
|
|
| 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. |
|
| Back to top |
|
 |
kilven Guest
|
Posted: Thu Apr 12, 2007 12:53 am Post subject: Need Help!!! |
|
|
| 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. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun May 06, 2007 10:48 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
joelhewitt Guest
|
Posted: Fri Jun 01, 2007 4:34 pm Post subject: keyboard remap |
|
|
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:
| Code: |
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...] |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Aug 29, 2007 11:24 pm Post subject: |
|
|
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! |
|
| Back to top |
|
 |
Nyo
Joined: 17 May 2008 Posts: 1
|
Posted: Sat May 17, 2008 6:22 am Post subject: |
|
|
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
| Code: | | %DDK_Ex% = kbfiltr, *PNP0BAAD |
into
| Code: | | %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. |
|
| Back to top |
|
 |
brasshopper
Joined: 06 Aug 2008 Posts: 2
|
Posted: Wed Aug 06, 2008 7:38 pm Post subject: Does this work in Vista |
|
|
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? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|