Normal Topic Tab versus Click (Read 799 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Tab versus Click
Oct 13th, 2007 at 6:33pm
Print Post Print Post  
Can Sesame tell the difference between a user entering an element using the Tab key as opposed to entering it with a mouse click?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Tab versus Click
Reply #1 - Oct 13th, 2007 at 6:38pm
Print Post Print Post  
Infinity wrote on Oct 13th, 2007 at 6:33pm:
Can Sesame tell the difference between a user entering an element using the Tab key as opposed to entering it with a mouse click?

Not under normal circumstances. Why?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Tab versus Click
Reply #2 - Oct 13th, 2007 at 6:53pm
Print Post Print Post  
There's programming in some of my forms that I would prefer to run if the user clicked on the element (combo boxes that fill with data from another database) rather than just tabbing his way through the form.

Not important, just curious.
  

**
Captain Infinity
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Tab versus Click
Reply #3 - Oct 13th, 2007 at 9:33pm
Print Post Print Post  
Two ideas:
1.  Set flag in previous element that is cleared when entering any other element
2.  Set flag in previous element that is cleared with inviisible "double click" operation.

Set a flag (global var) in the previous element.

Have programming in the "sensitive" element to only run if flag is NOT set.
Run subroutine from all other elements except previous element to turn off flag on Enter

Can now click with mouse in any other element first and run program code.  Just need to click in any other element except the previous one to enable the program with a mouse.  Tabbing would set the flag, inhibiting the code.

Or could put an element just  slightly above the previous element, to the left of the sensitive element.  That would turn off flag, almost like a double click at the element, but would be slightly above, and not executed when tabbing from element to the left.  It would execute on the line above, but would make it invisible.by using same background color vs. Invisibility.

Result is you can execute any time with the mouse, but if was tabbed in from previous element it will not run.

========================
These are both untested, but might be the seed for a sensible solution.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Tab versus Click
Reply #4 - Oct 15th, 2007 at 8:35pm
Print Post Print Post  
Hello Scott,

Rather than limiting it to just the tab key, you could have it do one thing on any key press that causes an enter(Arrow Keys, Tab, Enter, Shift Tab) and something else on a mouse click. And it would not need to depend on which element you were in previous to this one. All it would depend on is the Event State which Sesame allows you to get. The code, which would go on Element Entry, would be similiar to the following.

Code
Select All
#Include "Sbasic_Include.sbas"

Var vEventString as String
Var vEvent as Int

	vEventString = @EventState()
	vEvent = @ToNumber(@AccessStringArray(vEventString, 1))

	If vEvent = EVENT_KEYDOWN Then
	{
		//Tab or Key Press
		Company = "Key Press"
	}
	Else
	{
		//Click
		Company = "Click"
	} 



-Ray

P.S. If you implement this and you ever have to send it into Support be sure to tell us if we need to Click or Tab.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Tab versus Click
Reply #5 - Oct 15th, 2007 at 9:35pm
Print Post Print Post  
Quote:
P.S. If you implement this and you ever have to send it into Support be sure to tell us if we need to Click or Tab.

And don't implement this. Depending on a user to do one or the other consistently as a statement of intent is likely to end in pain and darkness.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Tab versus Click
Reply #6 - Oct 16th, 2007 at 1:35pm
Print Post Print Post  
Thanks Ray, but I think I'm going to do as Erika suggests and not implement the control.  What triggered my curiosity was, while testing 2.0.3, I was tabbing my way through a form and when I came to one element, a combo box which fills with "checkcodes" contained within the database itself, the XLookup function which fires off when a selection is made was blanking many of the target fields (I was making no selection, just tabbing through).

I discovered that one record, coded "0" and which had "To be determined" as Company info (with no other company info in the record, all blanks) did not actually have a Checkcode value.  Therefore the XLookup was doing exactly what it's supposed to do, looking up the record with the blank value and returning the blank information.  As soon as I gave record 0 a valid Checkcode there were no longer any blank Checkcodes in the database, so tabbing through the blank element no longer fired off the XLookup.

I then tightened up the code so no record can be saved with a blank Checkcode, and so the Xlookup ignores blanks in case they find a way to do so anyway.

Thanks for the help everyone!
  

**
Captain Infinity
Back to top
IP Logged