How to Take Total Control of the backspaceKey?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

How to Take Total Control of the backspaceKey?

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to Take Total Control of the backspaceKey?

Post 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
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Re: How to Take Total Control of the backspaceKey?

Post 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: How to Take Total Control of the backspaceKey?

Post 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
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Re: How to Take Total Control of the backspaceKey?

Post by deeverd »

Thanks Craig,

I'll give this a try, too.

Cheers,
deeverd
Post Reply