# How to get ASCII from multiple pressed keys

**URL:** <https://forum.csound.com/t/how-to-get-ascii-from-multiple-pressed-keys/2346>\
**Category:** Newbies\
**Created:** [December 13, 2025, 2:59pm UTC](https://forum.csound.com/t/how-to-get-ascii-from-multiple-pressed-keys/2346 "2025-12-13T14:59:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jstoro](https://forum.csound.com/letter_avatar_proxy/v4/letter/j/91b2a8/32.png) [@Jstoro](https://forum.csound.com/u/Jstoro)\
**Post date:** [December 13, 2025, 2:59pm UTC](https://forum.csound.com/t/how-to-get-ascii-from-multiple-pressed-keys/2346/1 "2025-12-13T14:59:04Z")

</div>

Hi guys!

I’m trying to make an instrument where I can change some parameters when two keys from the PC keyboard are pressed. For instance, I want to alter some kIdx variable that affects a parameter kParam when I press the down or up keys. To select the kParam I will use the letter “p” on the keyboard, hence the need for two different key values. I’m trying to do it with the sensekey opcode, but the variable it affects is univoque (just one value at a time). Do you have any idea of how could I implement this logic? So far, my test is functioning like this (it’s playing one event or another, not both):

instr 1  
kKeyLetter, kKeyPressed sensekey  
if (kKeyLetter == 105) then ; letter “i”  
event “i”, 2, 0, 3, 110  
endif  
if (kKeyLetter == 32) then ; space bar  
event “i”, 2, 0, 3, 550  
endif  
endin

instr 2  
aenv linen .8, p3\*.2, p3, p3\*.5  
asig poscil aenv, p4  
out asig  
endin

Thank you in advance!
