"." Shortcut

I used keyboard input for a simple little demo at work, echoing what I had typed on the screen. I thought I had a bug when I looked up and saw a stray “.” character that I hadn’t typed. It turned out to be Apple’s “.” shortcut, the one that inserts a period if you type two spaces within a short time. So I just turned the shortcut off.

I have a personal shortcut, “sgm”, that fills in my whole email address. When I type that into Codea’s keyboard, it sends first the three letters s g m and then the email address, so I’m left with both in the buffer.

Just something to watch out for - or could there be a way to disable shortcuts in Codea?

this would be a question for @simeon i guess.

@Ceres unfortunately Apple gives us no way to know about or react to shortcuts — it looks to us as if you just typed the relevant text. It’s really weird that it happens at such a low level.

We can detect the “.” shortcut and try to account for it, but might be out of luck on custom ones.

The shortcuts seems to be sensitive to timing, too. If I type blank, wait a while, and blank again, the “.” shortcut isn’t triggered.

I added some code for the backspace key, which allows me to correct the txt inserted by a shortcut. The custom shortcuts are triggered when you follow the shortcut with a space. If you follow the shortcut with another key, then backspace and then type the space key, the shortcut is not triggered.