Re: Keystroke handling

2018-01-25 Thread Keisuke Miyako via 4D_Tech
perhaps you could use OBJECT SET EVENTS

http://doc.4d.com/4Dv16/4D/16.3/OBJECT-SET-EVENTS.301-3651506.en.html

to disallow the default button's click event during text edit. (its more subtle 
than disabling them)

> 2018/01/26 0:35、Jim Crate via 4D_Tech <4d_tech@lists.4d.com> のメール:T
> I’m not trying to filter user input.



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Keystroke handling

2018-01-25 Thread Arnaud de Montard via 4D_Tech

> Le 25 janv. 2018 à 16:35, Jim Crate via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I’m not trying to filter user input. I’m trying to trap certain 
> navigation-related keystrokes. I am trying to implement a relatively simple 
> generic auto-complete that allows me to customize the query used to generate 
> the autocomplete list. I’m displaying a listbox under the field the user 
> types in, and filtering the arrow keys to navigate the list. The idea is for 
> the user to type a couple letters, down arrow a couple times to the choice 
> they want, and hit return to select it. The arrow keys can be detected in On 
> Before Keystroke, and that part works fine. The return/enter keys cannot be 
> detected that way. It’s frustrating to have to think about the hassle of 
> managing the choice list in another window just because On Before Keystroke 
> doesn’t detect certain keystrokes.

Have you seen that?

I still did not used it in production but I do like the concept: 
1/ no object to add to the host form
2/ it uses a window actually (popup), but the input zone belongs to the same 
form as the list superimposed; this way, the host form input management and the 
list one are completely independent. 

-- 
Arnaud de Montard 




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Keystroke handling

2018-01-25 Thread Jim Crate via 4D_Tech
I’m not trying to filter user input. I’m trying to trap certain 
navigation-related keystrokes. I am trying to implement a relatively simple 
generic auto-complete that allows me to customize the query used to generate 
the autocomplete list. I’m displaying a listbox under the field the user types 
in, and filtering the arrow keys to navigate the list. The idea is for the user 
to type a couple letters, down arrow a couple times to the choice they want, 
and hit return to select it. The arrow keys can be detected in On Before 
Keystroke, and that part works fine. The return/enter keys cannot be detected 
that way. It’s frustrating to have to think about the hassle of managing the 
choice list in another window just because On Before Keystroke doesn’t detect 
certain keystrokes.

Jim Crate


> On Jan 24, 2018, at 11:11 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> the "On Losing Focus" event fires as a "result" of another object taking its 
> focus way.
> 
> is the default button focusable?
> 
> I don't think you can write generic code without knowing the next/previous 
> object in entry order.
> 
> also, keystrokes are not the only way to edit text, it can be drag and drop, 
> context menu, speech input, etc.
> On After Edit is especially useful because it catches all means of edit, 
> including copy and paste.
> (as an example, in Japanese we press the keyboard many times to compose a 
> single character)
> 
> thinking only in terms of keystrokes feels like going in the opposite 
> direction.
> 
>> 2018/01/25 12:05、Jim Crate via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> However, with a default button on the form, I don’t even get an On Losing 
>> Focus event.
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Keystroke handling

2018-01-24 Thread Keisuke Miyako via 4D_Tech
the "On Losing Focus" event fires as a "result" of another object taking its 
focus way.

is the default button focusable?

I don't think you can write generic code without knowing the next/previous 
object in entry order.

also, keystrokes are not the only way to edit text, it can be drag and drop, 
context menu, speech input, etc.
On After Edit is especially useful because it catches all means of edit, 
including copy and paste.
(as an example, in Japanese we press the keyboard many times to compose a 
single character)

thinking only in terms of keystrokes feels like going in the opposite direction.

> 2018/01/25 12:05、Jim Crate via 4D_Tech <4d_tech@lists.4d.com> のメール:
> However, with a default button on the form, I don’t even get an On Losing 
> Focus event.



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Keystroke handling

2018-01-24 Thread Jim Crate via 4D_Tech
I would like to intercept the tab/return/enter keys using the On Before 
Keystroke form event. However, with a default button on the form, I don’t even 
get an On Losing Focus event. With the default button not specified, the return 
key functions the same as a tab, so I can detect losing focus at least. 
However, I’m trying to make a bit of generic code, and a requirement to never 
have a default button is kind of limiting. Hopefully I’m missing something 
obvious?

Also, I’d like to be able to fire the On After Edit event. The docs mention 
programmatic changes to a variable do not fire On After Edit (which is useful), 
but POST KEY will. However, if the variable contains the text I’d like to have 
available in On After Edit, is there a good value to use with POST KEY which 
will not change the value but will fire the event? Am I going to have to do 
something as kludgy as set the value to the value minus the last character, 
HIGHLIGHT TEXT, and POST KEY the last character?

Having all keystrokes available to filter in On Before Keystroke and a POST 
FORM EVENT command would definitely be useful.

Jim Crate

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**