For keys which a terminal can't even send unmodified (which I suspect is the case with <kp-add>
), you will need to bind some key which can be sent by the terminal.
You can bind a key to the keyboard macro [kp-add]
in order that the alternative key sequence does whatever <kp-add>
would have done:
(global-set-key (kbd "C-c p") (kbd "<kp-add>"))
You could even call a macro without a key binding:
M-: (execute-kbd-macro (kbd "<kp-add>"))
RET
Alternatively, you could use function-key-map
(or the terminal-local local-function-key-map
) to directly map the key sequences like so:
(define-key function-key-map (kbd "C-c p") (kbd "<kp-add>"))
in which case Emacs translates C-c p
to <kp-add>
(as opposed to calling a macro which in turn simulates typing <kp-add>
).
In practice, both methods ought to do the job.
<C-return>
would be similar, but C-RET
can be sent via event-apply-control-modifier
like so:
C-x@cRET
If the terminal can send the unmodified key, you can use this approach to send a modified variant. Type C-x@C-h for the list of supported modifiers.