Is this Property field not possible somehow?
[{"id":"68148f1c8b759f89","type":"inject","z":"be03f9025a1f137a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"event\":{\"code\":\"00afbbcc\"}}","payloadType":"json","x":750,"y":555,"wires":[["8604e7c799cf70fd","29ad7e990c909a79"]]},{"id":"8604e7c799cf70fd","type":"function","z":"be03f9025a1f137a","name":"function 3","func":"msg.test = msg.payload.event.code.slice(-1);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":925,"y":495,"wires":[["2fd1f9149100f45f"]]},{"id":"2fd1f9149100f45f","type":"debug","z":"be03f9025a1f137a","name":"debug 10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1140,"y":525,"wires":[]},{"id":"29ad7e990c909a79","type":"switch","z":"be03f9025a1f137a","name":"split by button","property":"payload.event.code.slice(-1)","propertyType":"msg","rules":[{"t":"eq","v":"8","vt":"str"},{"t":"eq","v":"c","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"9","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"5","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"3","vt":"str"}],"checkall":"false","repair":false,"outputs":8,"x":950,"y":630,"wires":[[],["2fd1f9149100f45f"],[],[],[],[],[],[]]}]