kbfiltr mapping keys

Hi,

I use a software called Traktor. It is a DJ software and I wanted to use multiple keyboards (One as standard, one as hotkey). So I found a kbfiltr file and it works great but Trakor can only use the shift, ctrl, alt, win, menu, caps keys as modifiers. I wanted to find a way so that I can remap them to other keys. I wanted someone to hlep me so that it is like a template in the kbfiltr file I have attched below. Note that at the moment the kbfiltr adds a Alt/Shift key combo to everykey that is pressed.

S can someone add a template sort of thing to this code so I can add new remap codes to it using hard coded scan codes.

Please help me I am desperate

Thanks for everything guys, this is a great forum

No code was attached, but the key to your problems is the function
KbFilter_ServiceCallback. You are passed an array of
KEYBOARD_INPUT_DATA elements. You can modify the ScanCode and Flags
field of each element to remap to the key of your choosing. If you want
to dynamically change the mappings, then you will need to have an array
of a mapping structure, something like

typedef struct _SCANCODE_MAP {
UCHAR FromScanCode;
UCHAR ToScanCode;
UCHAR ToFlags;
} SCANCODE_MAP, *PSCANCODE_MAP;

This array is searched for every KEYBOARD_INPUT_DATA you see. You can
modify the KEYBOARD_INPUT_DATA element passed to your driver in place.
You will also have an IOCTL for your raw PDO (this is assuming you are
using the KMDF version of kbdfiltr) which adds or removes scan code
mappings. You will reallocate the array on addition or removal.

You need to guard access to this array with a spinlock in both the IOCTL
code which reallocates the array and KbFilter_ServiceCallback where it
touches the array looking for a scancode to map.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Monday, May 07, 2007 8:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] kbfiltr mapping keys

Hi,

I use a software called Traktor. It is a DJ software and I wanted to use
multiple keyboards (One as standard, one as hotkey). So I found a
kbfiltr file and it works great but Trakor can only use the shift, ctrl,
alt, win, menu, caps keys as modifiers. I wanted to find a way so that I
can remap them to other keys. I wanted someone to hlep me so that it is
like a template in the kbfiltr file I have attched below. Note that at
the moment the kbfiltr adds a Alt/Shift key combo to everykey that is
pressed.

S can someone add a template sort of thing to this code so I can add new
remap codes to it using hard coded scan codes.

Please help me I am desperate

Thanks for everything guys, this is a great forum


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I’m extremely sorry for that but here is the code attached:

http://my.ofs.edu.sg/user/mohit/kbfiltr.c

sorry for the repost but I justed wanted to say that Doron and anybody helping you will have to bare with me because I am only 14 and it is hard to grasp all this at once so It’ll be good if you could please, please use samples and add things to the file posted above,

Thanks guys

Sorry, but I am not going to write the code for you :). I commend you
for taking on such a complicated project at a young age, but getting
this work as a first time driver project, especially with little
experience is going to be a long road. The big question for you is if
the remapping you to do must be dynamic or not. If it is not dynamic
and is a fixed table that you want to remap to, your project becomes
simpler.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Tuesday, May 08, 2007 2:57 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] kbfiltr mapping keys

sorry for the repost but I justed wanted to say that Doron and anybody
helping you will have to bare with me because I am only 14 and it is
hard to grasp all this at once so It’ll be good if you could please,
please use samples and add things to the file posted above,

Thanks guys


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

What is the difference between dynamic remapping and fixed remapping

Fixed - the table of keys is fixed in the driver itself. You cannot
change the map while the driver is loaded. An application cannot change
the mapping

Dynamic - the table of keys can change after the driver is loaded. An
application can change the mapping at any time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Tuesday, May 08, 2007 3:28 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] kbfiltr mapping keys

What is the difference between dynamic remapping and fixed remapping


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Surely I’d like them to be fixed (If I understand correctly the key label will b installed with th driver, and can’t be changes unless I change the kbfiltr file and reinstall the driver, right). And If I want the default keyboard (normal setup without any remapping) I can jut rollback to the windows or manufacturer’s driver.

If this is so then I would like to have fixed.

Thanks Doron

Could someone please tell me what would be the functions tobe carried out if I want to used FIXED remapping.

Thanks

Doron have already responded. Patch the scancodes in the array which is
going thru your ServiceCallback.

You can even remove some scancodes from it, collapsing the hole with
RtlMoveMemory and patching the array length value.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Could someone please tell me what would be the functions tobe carried out if
I want to used FIXED remapping.
>
> Thanks
>

Thanks for the replies but most of what Doron said doesn’t really make sense to me so some examples would REALLY be helpful

I think I read that you are 14? My compliments. Picking something
challenging at a young age is very commendable, but I find your ability
to exploit resources such as this list, much more remarkable, and, in
the big picture, much more useful, because a tremendous amount of this
type of work is about research, and, as you’re discovering the hard way,
is often the harder part of the battle. That you somehow got to this
list knowing that you needed to write a keyboard filter, at your age, is
exceptional; but that you did all of this because you were pissed off at
the way some video game works (if I recall correctly) is what I find
truly remarkable. I worked with subject matter like this when I was
your age, but I know I never would have done any of it had it not been
right in front of me and required that I demonstrate the persistence and
courage that you have. I say courage because I would have been way to
afraid to ask something on a list like this, even if such a thing had
existed.

For all of these reasons, I would like to help, but I am seriously
constrained by not knowing anything about kbfiltr, or input on Windows
in general. For all of those same reasons, I have to agree with Doron
here - you’ve got to tackle this one yourself. However, what I would
suggest, as this is presumably just a learning experience for you, you
might want to check out Ctrl2Cap first
(http://www.microsoft.com/technet/sysinternals/utilities/Ctrl2Cap.mspx).
It’s an old sysinternals utility, whose Windows 95 version predates my
professional life. It used to come with source, but that seems to no
longer be the case. A quick google will find you some clones, possibly
as it were, with source code that should be taken and trusted only as
such a thing should, but it is a place to start. I really don’t
remember what exactly you’re trying to accomplish, and it probably won’t
do exactly what you need, and, all in all, this may not even be very
good advice in the big picture, but it is quite simple, and I think that
this merits its consideration in your case.

I hope this helps. I’ll be happy to answer any specific questions that
you have, anytime, but you’ve got write this one yourself. In the
future, please try to include the previous responses or at least the
original question in your posts. Otherwise, it’s very hard to
understand what you seek, and the odds of me going back to find the
original post again are not very good.

Good luck,

mm

>> xxxxx@gmail.com 2007-05-10 20:43:15 >>>
Thanks for the replies but most of what Doron said doesn’t really make
sense to me so some examples would REALLY be helpful


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks for the encouraging message but I don’t think I will be able to use the windows page that is provided because that is an upperfilter and my kbfilter adds the keys that I want to remap to every keypress anyways (That’s why I want to remap them), if I use something like that then the added key combo will also be reamapepd. Thanks a lot for the messsage and effort, I think I will have to do it myself but I didn’t understand anything about the arrays (If I did I could attempt it)

Mohit

------Original Message------

MM
xxxxx@evitechnology.com

RE:kbfiltr mapping keys

I think I read that you are 14? My compliments. Picking something challenging at a young age is very commendable, but I find your ability to exploit resources such as this list, much more remarkable, and, in the big picture, much more useful, because a tremendous amount of this type of work is about research, and, as you’re discovering the hard way, is often the harder part of the battle. That you somehow got to this list knowing that you needed to write a keyboard filter, at your age, is exceptional; but that you did all of this because you were pissed off at the way some video game works (if I recall correctly) is what I find truly remarkable. I worked with subject matter like this when I was your age, but I know I never would have done any of it had it not been right in front of me and required that I demonstrate the persistence and courage that you have. I say courage because I would have been way to afraid to ask something on a list like this, even if such a thing had existed. For all of these reasons, I would like to help, but I am seriously constrained by not knowing anything about kbfiltr, or input on Windows in general. For all of those same reasons, I have to agree with Doron here - you’ve got to tackle this one yourself. However, what I would suggest, as this is presumably just a learning experience for you, you might want to check out Ctrl2Cap first (http://www.microsoft.com/technet/sysinternals/utilities/Ctrl2Cap.mspx). It’s an old sysinternals utility, whose Windows 95 version predates my professional life. It used to come with source, but that seems to no longer be the case. A quick google will find you some clones, possibly as it were, with source code that should be taken and trusted only as such a thing should, but it is a place to start. I really don’t remember what exactly you’re trying to accomplish, and it probably won’t do exactly what you need, and, all in all, this may not even be very good advice in the big picture, but it is quite simple, and I think that this merits its consideration in your case. I hope this helps. I’ll be happy to answer any specific questions that you have, anytime, but you’ve got write this one yourself. In the future, please try to include the previous responses or at least the original question in your posts. Otherwise, it’s very hard to understand what you seek, and the odds of me going back to find the original post again are not very good.
Good luck, mm

MM wrote:

I think I read that you are 14? My compliments. Picking
something challenging at a young age is very commendable,
[…] but that you did all of this because you were pissed off at
the way some video game works (if I recall correctly) is what I
find truly remarkable.

Come on, 14 is not that young for getting into programming. I would bet that most people on this list got into it far earlier…

Chris Aseltine wrote:
Come on, 14 is not that young for getting into programming. I would bet that most people on this list got into it far earlier…

Sure its not that early to get into programming but this kind of thing is not that simple either. And really it depends on each person what they make of it

Not me. When I was younger than that, there were no personal computers. I
never saw a mainframe until years later.


David J. Craig
Engineer, Sr. Staff Software Systems
Broadcom Corporation

wrote in message news:xxxxx@ntdev…
> MM wrote:
>
>> I think I read that you are 14? My compliments. Picking
>> something challenging at a young age is very commendable,
>> […] but that you did all of this because you were pissed off at
>> the way some video game works (if I recall correctly) is what I
>> find truly remarkable.
>
> Come on, 14 is not that young for getting into programming. I would bet
> that most people on this list got into it far earlier…
>

14 is not early for programming in general …but 14 is a bit early for
something as complicated as writing a driver (IMHO).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Saturday, May 12, 2007 7:38 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] kbfiltr mapping keys

Chris Aseltine wrote:
Come on, 14 is not that young for getting into programming. I would bet
that most people on this list got into it far earlier…

Sure its not that early to get into programming but this kind of thing
is not that simple either. And really it depends on each person what
they make of it


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

thanks, doron I just couldn’t word it well.

An particular reason you felt the need to share this? Did you read the
whole thing? I kind of spell it out in the part you didn’t quote, but
also partially in the what you did quote. Incidentally, did you read
his response to my post? He told me that what I suggested, ctrl2cap,
would not meet his needs. I think he missed my point, which was that,
while not really what he wanted, it is simpler than what he was already
having trouble with and it might be a good place to start and an
experience from which to learn, which is all he really may get from us,
as no one including myself is going to solve this one for him; that
notwithstanding, and moreover, because of, yes, I do think his
confidence and drive is exceptional, which was what I emphasized. He
may only be 14, but, in my humble opinion, you could learn a think or
two about posting from him.

Say what you will about what I wrote; I was trying to help him. What
you wish to project with out being accountable for the want itself is
pretty obvious.

This is just lame.

mm

>> xxxxx@gmail.com 2007-05-12 13:03 >>>
MM wrote:

I think I read that you are 14? My compliments. Picking
something challenging at a young age is very commendable,
[…] but that you did all of this because you were pissed off at
the way some video game works (if I recall correctly) is what I
find truly remarkable.

Come on, 14 is not that young for getting into programming. I would
bet that most people on this list got into it far earlier…


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Guys, can we please not discuss this any further (Whether I am too young to program at this level or not. It is everyone’s personal opinion).

So I couldn’t really make of what Doron wrote in his first post. Can someone please tell me that in “english”… no offense.

Please guys leave the matter og age alone and try to help me, I would be really grateful to you if I succeeded in mapping keys from driver level.

Thanks a lot