Cubase 5 generic remote device. Problem with recording.

Hello, I’m trying to set up the generic remote device using my Casio digital piano as a midi controller. I’ve assigned my piano’s middle pedal to perform the transport-record function and when I press the pedal I see that the record button is pressed too, yet I have to hold the pedal during all of the time needed for the recording to be on. In other words, If I don’t hold the pedal the recording stops. Or if I just press it and immediately release it the record button gets pressed but the recording doesn’t start at all. Only press and hold works.
I’d be very grateful for some clarification on the matter. What I need is to press the pedal once shortly and have the record on, then press it again shortly and have the record immediately off.
Please explain as simply as you can do it for a newbie. Thanks!

An update: any pedal assigned to trigger any transport command requires to press-hold it until the command is executed. It takes more than a second for any of the assigned actions to run. And in case of recording, it is not enough to just wait, first I have to wait for the recording to start and second I have to hold the pedal until the recorded fragment is over. What am I missing?

I always needed notes to trigger the GR, the pedal is a cc right?
Does it work if you use a button or note, something other than the pedal?

Yes, the pedals are definitely CC’s! You’ve directed me in the right direction, thanks! And yes everything works with the notes just fine except for the 2-second gap between the pressing of the key/transport button and the actual beginning of the recording. But indeed at least I don’t have to hold the key all the way)
So, how do you think it is possible to work with a CC to somehow achieve the desired results?
And if I decide not to complicate things and use a keyboard key instead how do I remove that 2-sec gap?
Thank you a lot for your help!

You should have your equipment in your signature, good practice. Interface/OS/processor etc.

I don’t know about a 2 second delay. Is it like that for everything you do using the GR?

I had a yamaha foot switch that I really liked but it only put out program changes.

I got one of these:

http://www.midisolutions.com/prodevp.htm

which can do most anything and it changed program change messages into note messages on the fly so that I could use the footswitch to change tools for editing in Mellodyne. Made workflow a lot quicker.

There’s a software version of the event processor called Midi Translator.

https://www.bome.com/products/miditranslator

These are extreme solutions and require a lot on your part, much easier to just use note messages or get a small control surface, those can be pretty cheap like the ones made for Ableton.

Event processor… nice, must be a handy thing to use. Actually, I thought about some way to set the limits to the value of the CC, read about it somewhere, probably here on the forum, that not only Max value should be set to 127 but the Min value too. Just don’t know where to do this.
As to the delay, yes it happens with whichever transport command I use. The pressing itself happens immediately, I see the button being pushed in Cubase but the execution of the function itself begins only after those 2 seconds. That’s strange and I think should have some simple solution to it.