the input action should define the way the event works.
on the imc you bind which key is assigned to which action (for a specific context (the C in imC)). (input mapping context).
try setting it there.
you will need another action for the other things you want to do.
as for this:
there are a couple of nodes to change the cursor mode
notice that there is another node for actually showing the cursor or not.
note:
if that fixes your query, take a look at the docs, since it’s a well documented core concept, and you might be missing others.