if you want to alter the midi data, then generally id suggest you write a simple patch e.g.
midi/in/keyd -> midi/out/note
midi/out/note allows you to specify not only device, but also midi channel
(and you can have multiple midi/out/note if you want to go to different channels)
this should all be done in a polyphonic sub-patch (assuming you want it polyphonic) , and if necessary select 'has midi selector' , if you want to filter the incoming midi by channel or device
the other (slightly more complex) option is to copy/edit the midi thru script and adapt to you needs...
its a 'trivial' modification, but requires that you are a little confident with C/C++,
if not then Id suggest sticking to the patching route described above
(the advantage of using thru scripts, is they process the midi directly, so don't need voices, or potentially alter things due to legato styles etc. ... but for many purposes the patching route is fine, and opens up a lot of creative possibilities)