I tried on a test application Desktop on Mac… push button action writes the result string s on label.value … It worked I don’t know what’s wrong with your code . Should work
I just came back to delete my question, apologies, it must be time to just go to bed…
It turns out (in as far as I can tell) that I had embedded a non printable character inbetween some of the plus signs. It’s something that get’s me every now and then because I haven’t programmed my desktop for the xojo IDE. I have “shift+space” customised to be a non breaking space in my xmodmap. I’m usually aware of it, but when it comes to app development (on this particular machine) I occasionally forget about it. Because there were so many spaces in those lines of code and shifted characters immediately before or after, they kept slipping in. Once I broke it down line by line and entered it slowly, it worked…
Changing xmodmap now
xmodmap -pke
...
keycode 65 = space nobreakspace space nobreakspace
...