Page 1 of 1

How to Take Total Control of the backspaceKey?

Posted: Sun Dec 10, 2017 1:43 am
by deeverd
Hello Forum,

When using "on backspaceKey" the program will do whatever I want it to do with that handler. But...

The problem is that when having the backspaceKey do something other than what it normally does (going backwards and deleting the character behind it), it no longer deletes the character behind it.

So, how do I use "on backspaceKey" as a handler yet also be able to go backwards in a field and delete the character behind it, too?

I'm using Windows 10 OS and LiveCode 8.13.

Thanks to whomever can answer this question.

Cheers

Re: How to Take Total Control of the backspaceKey?

Posted: Sun Dec 10, 2017 2:12 am
by Klaus
Hi deeverd,

at any time you can -> pass backspaceKey
and it will leave your handler and do what it is meant to do :D


Best

Klaus

Re: How to Take Total Control of the backspaceKey?

Posted: Sun Dec 10, 2017 2:45 am
by deeverd
Hi Klaus,

Easy peasy. Works like a charm.

Didn't know it was so simple as just using the word "pass" with the handler, inserted in the right place.

Great tip since I now know to use "pass" - when appropriate - with just about any other type of handler that is based on using a particular key.

It's the simple tips that are best.

Thanks!

Cheers,
deeverd

Re: How to Take Total Control of the backspaceKey?

Posted: Sun Dec 10, 2017 4:08 am
by dunbarx
Try this. On a new card make a field with some text in it. Put this in the card script:

Code: Select all

on backSpaceKey
  if the commandKey is down then answer "Your commandKey is down, you know"
  else pass backSpaceKey
  end backSpaceKey
Place the cursor in the text. Play...

Craig Newman

Re: How to Take Total Control of the backspaceKey?

Posted: Sun Dec 10, 2017 5:48 am
by deeverd
Thanks Craig,

I'll give this a try, too.

Cheers,
deeverd