Re: Trapping the 'return' key in list forms

2019-12-04 Thread Arnaud de Montard via 4D_Tech
> Le 4 déc. 2019 à 10:55, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > On 4 Dec 2019, at 08:26, Arnaud de Montard via 4D_Tech <4d_tech@lists.4d.com> > wrote: >> >> Hi Peter, >> I'm not sure it always works on mac, because focusable property is managed >> by system and

Re: Trapping the 'return' key in list forms

2019-12-04 Thread Peter Jakobsson via 4D_Tech
Hi Jeremy In fact, with this approach there’s not even any need for the invisible buttons - just associate the [Return] key with the visible default button and the script can decide whether to execute the query or the default “Accept” action. Regards Peter > On 4 Dec 2019, at 09:40, Jeremy

Re: Trapping the 'return' key in list forms

2019-12-04 Thread Jeremy Roussak via 4D_Tech
On 4 Dec 2019, at 08:26, Arnaud de Montard via 4D_Tech <4d_tech@lists.4d.com> wrote: > > Hi Peter, > I'm not sure it always works on mac, because focusable property is managed by > system and "stronger" than 4d's one. You may check if I'm wrong using Apple > menu/Keyboard/Shortcuts/Full

Re: Trapping the 'return' key in list forms

2019-12-04 Thread Jeremy Roussak via 4D_Tech
> On 3 Dec 2019, at 22:40, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > >> On 3 Dec 2019, at 21:47, Peter Bozek wrote: > >> But doing it again, I would go for something simpler. > > …and that “something simpler” turns out to be Jeremy Roussak’s tip of > removing the

Re: Trapping the 'return' key in list forms

2019-12-04 Thread Arnaud de Montard via 4D_Tech
> Le 3 déc. 2019 à 23:40, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > >> On 3 Dec 2019, at 21:47, Peter Bozek wrote: > >> But doing it again, I would go for something simpler. > > …and that “something simpler” turns out to be Jeremy Roussak’s tip of > removing the

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Peter Jakobsson via 4D_Tech
> On 3 Dec 2019, at 21:47, Peter Bozek wrote: > But doing it again, I would go for something simpler. …and that “something simpler” turns out to be Jeremy Roussak’s tip of removing the “Focusable” property from the default button on the form. This is the key to everything, including: 1. The

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Peter Bozek via 4D_Tech
Sorry to enter the thread late, but tried to implement similar functionality several years ago. Ended up with variable set in On getting / on loosing focus. Button that handled Enter checked value of the variable and either processed script or saved record. Final implementation was more complex,

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Chip Scheide via 4D_Tech
Typo in the previous message - not 120 ticks 20 or 30 :) On Tue, 3 Dec 2019 15:21:39 +, Peter Jakobsson wrote: > Hi Chip > > Thanks for the reply. I’ve seen that approach on some web based systems. > > Could be good, could be bad. I see some users loving it and others > hating it. The

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Peter Jakobsson via 4D_Tech
Hi Chip Thanks for the reply. I’ve seen that approach on some web based systems. Could be good, could be bad. I see some users loving it and others hating it. The machine trying to “second guess” that the user has typed enough into the filter field sometimes makes it feel flaky because it’s

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Chip Scheide via 4D_Tech
have you considered using a timer to auto search for the user? i.e. user types: "App" and after a brief delay the searches auto executed using the user entered information? I use 120 ticks. then they do not have to hit return at all On Tue, 3 Dec 2019 00:26:24 +, Peter Jakobsson via

Re: Trapping the 'return' key in list forms

2019-12-02 Thread Peter Jakobsson via 4D_Tech
Many thanks Kirk, and to those who responded to this thread. I’ve tried a variety of approaches in a virgin structure. The simplest appears to be one that was first suggested by Jeremy Rusak but others also alluded to: simply remove the “Focusable” property from the default button (or a button

Re: Trapping the 'return' key in list forms

2019-12-02 Thread Kirk Brooks via 4D_Tech
Hey Peter, I was just reading through your question and the answers and I noticed the solutions get sort of complicated. I think the reason is the task you're describing a little unusual. Having one keystroke, the return key, perform two very different actions can result in a non-intuitive UI.

Re: Trapping the 'return' key in list forms

2019-12-02 Thread Arnaud init5 imap via 4D_Tech
> Le 30 nov. 2019 à 22:58, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > Thanks for that input Chip. > > However I don’t see how this can work. How can the invisible button script > know which field the cursor was in last ? (Or which object last had the focus > prior to

Re: Trapping the 'return' key in list forms

2019-11-30 Thread Jeremy Roussak via 4D_Tech
Peter, If your button, with shortcut Return, does not have the “focusable” property checked, calling OBJECT Get pointer(Object with focus) in its script will return the object the cursor was in when the return key was pressed. Jeremy > On 30 Nov 2019, at 21:58, Peter Jakobsson via 4D_Tech

Re: Trapping the 'return' key in list forms

2019-11-30 Thread Peter Jakobsson via 4D_Tech
Thanks for that input Chip. However I don’t see how this can work. How can the invisible button script know which field the cursor was in last ? (Or which object last had the focus prior to its own script being executed ?) Regards Peter > On 29 Nov 2019, at 22:13, Chip Scheide

Re: Trapping the 'return' key in list forms

2019-11-29 Thread Chip Scheide via 4D_Tech
invisible button with as the activation key, which could then POST KEY(). or you know... User training :) CHip > Hi > > Could anyone kindly bring me up to date me how we trap the [Return] > key on a form these days with a default button when some other action > is to be taken rather than

Trapping the 'return' key in list forms

2019-11-29 Thread Peter Jakobsson via 4D_Tech
Hi Could anyone kindly bring me up to date me how we trap the [Return] key on a form these days with a default button when some other action is to be taken rather than accepting the form, depending on the last object that had the focus prior to executing the Default Button script ? In