How to "preview" keydown?

How can I intercept key-press?
I would like to do something like:
if user presses F9 a method is executed,
if user presses CTRL+H another method is executed
if usere presses Q the character passed to the current filed is W
and so on…

I need semething to “preview” the keyboard before the keydown event is really passed to the form and eventually do somenthing…

This could be form-based or if possible solution-based.

attaching keystrokes with methods is on the planning.

the Q==W isn’t something you do with key events. These things must behandled by the document model. This is not on the planning.

attaching keystrokes with methods is on the planning.

What I need is not exacly this.

I’d like an event previewer function to intercept keystrokes and discard/modifiy/do other…

What Servoy doesn’t have is a true event model, so one can do something as a consequence of events on objects:
mouse up, mouse down, key down, key up, right click, left click etc…

The onAction event for exaple is too generic.
It would be very usefull to have for each object a rich set of event handlers as other RSBMS (Visual FoxPro, Ominis, 4th Dimension…)

Without this the UI of a solution is very limited.

when do you really need those?

I have seen many many solutions now which where not limitted by at all without those events.

About keydown:

  • permit the user to let the mouse and work only with keyboard, emulate button click and other events with keystrokes without letting current field or without using two keys (example: F7 and not CTRL+N to create new record)
  • filter input to do special validation on some fields

About Right click:

  • open a contextual menu based on the object the user clicked over
  • open a lookup table

Bouble click:

  • do some action different from single clic
    This could be very userfull even on form elements like labels etc…

Enter field and leave field:

  • do some calculations

etc… etc.. etc…

Event handling is very important for building good applications (of course I require a lot of other things first of all a complete customizable manu-bar…) and I think this is the main lack of Servoy. It is very good in data manipulation, but not in th GUI.
Have a look at others RDBMS (not Filemaker! It is something for play, not for work)!

RDBMS? (Relational Database Management Systems) don’t have ANY gui or events things. Because a rdbms is just a database.
So i think you mean other tools that build ontop of those things. Like a Java IDE or VS.NET.

CTRL-N → F7 is in the planning (menu’s customizeable)
context menu’s are also on the planning.

Filter input should be done with a format in a textfield (now working on textfields in 2.1.2). And filtering input isn’t done on key events in java but is done in the document model. The way the masktextfield (a textfield with a format) works.

double click are only applicable on labels (double clicking on a button or textfield doesn’t make sense or has an other meaning)

Enter and leave field? that is focus lost and gained. You have those events.

Ofcouse we can give some events, but we don’t want to make tons of things that are almost never used or only valid in one case. We want everything to be as simple as possible.

RDBMS? (Relational Database Management Systems) don’t have ANY gui or events things. Because a rdbms is just a database.
So i think you mean other tools that build ontop of those things. Like a Java IDE or VS.NET.

I mean Visual FoxPro, Omnis Studio, 4th Dimension etc…
I call them R(apid)DBMS because they are so commonly called, maybe this is not strictly right, they should be called RDBADS (Rapid Database Application Developing Systems) or another way…

CTRL-N → F7 is in the planning (menu’s customizeable)

Ok, but what if I would like to do something like this: when the user presses F7 a method doing some selects and calculations fire, then the result is showed in graph and printed?
Moreover by “customizeable menu” I mean I can change the content of all menubar: I want menus File,Edit,Archive,Abc,Xyz etc.. and File has items Item1,Item2 etc… associated with a list of methods.

context menu’s are also on the planning.

OK

Filter input should be done with a format in a textfield (now working on textfields in 2.1.2). And filtering input isn’t done on key events in java but is done in the document model. The way the masktextfield (a textfield with a format) works.

I don’t know Java and its object model, but there are things not doable with masks.

double click are only applicable on labels (double clicking on a button or textfield doesn’t make sense or has an other meaning)

double click on a text filed could open a lookup table. I do this in my applications developed in Visual FoxPro.

Enter and leave field? that is focus lost and gained. You have those events.

Sorry, I missed this.

Ofcouse we can give some events, but we don’t want to make tons of things that are almost never used or only valid in one case. We want everything to be as simple as possible.

Ok for simplicity but UI is what the user uses every day, and more possibilities I have better I can satify the user.

This is a list of events an edit field in Microsoft Visual FoxPro can handle,
have a look:
click, doubleclick, destroy, dragdrop, dragover, error, errormessage, gotfocus, init, interactivechange, keypress, lostfocus, message, middleclick, mousedown, mouseenter, mouseleave, mousemove, mouseup, mousewheel, olecompletedrag, oledragdrop, oledragover, olegivefeedback, olesetdata, olestartdrag, programmaticchange, rangehigh, rangelow, rightclick, uienable, valid, when.

A lot of them doesn’t have sense in Servoy, but in my applications I often used a lot of mouse and keyborad events! I think I never used only about 10% of those events.

a.mariottini:

RDBMS? (Relational Database Management Systems) don’t have ANY gui or events things. Because a rdbms is just a database.
So i think you mean other tools that build ontop of those things. Like a Java IDE or VS.NET.

I mean Visual FoxPro, Omnis Studio, 4th Dimension etc…
I call them R(apid)DBMS because they are so commonly called, maybe this is not strictly right, they should be called RDBADS (Rapid Database Application Developing Systems) or another way…

I second this. Database Systems have no GUI. Database Management Systems to be used by Systems Administrators and the like don’t usually have rich interfaces. A completly diferent issue is end-user GUI interface, in today’s world user’s expect what is the windows common user interface. They have some expectations about the behaviour of certain things short-cut keys, menus, etc. Also for data intensive apps (database backed) users expect some extra functionality specific to the app - because this is such a time saver. Todays expectancy levels are much higher and used to be!

CTRL-N → F7 is in the planning (menu’s customizeable)

Ok, but what if I would like to do something like this: when the user presses F7 a method doing some selects and calculations fire, then the result is showed in graph and printed?
Moreover by “customizeable menu” I mean I can change the content of all menubar: I want menus File,Edit,Archive,Abc,Xyz etc.. and File has items Item1,Item2 etc… associated with a list of methods.

What about no menu? If one whiches to develop an app with no menu it should be possible.

context menu’s are also on the planning.

OK

Great!

Filter input should be done with a format in a textfield (now working on textfields in 2.1.2). And filtering input isn’t done on key events in java but is done in the document model. The way the masktextfield (a textfield with a format) works.

I don’t know Java and its object model, but there are things not doable with masks.

No comments. Don’t know the first thing about Java (not much about anything else too ;-)

double click are only applicable on labels (double clicking on a button or textfield doesn’t make sense or has an other meaning)

double click on a text filed could open a lookup table. I do this in my applications developed in Visual FoxPro.

I have the same experience as an end-user and with event handling in development environments.

Enter and leave field? that is focus lost and gained. You have those events.

Sorry, I missed this.

Good show!

Ofcouse we can give some events, but we don’t want to make tons of things that are almost never used or only valid in one case. We want everything to be as simple as possible.

Ok for simplicity but UI is what the user uses every day, and more possibilities I have better I can satify the user.

I’am by no means a sofisticated user, but it’s the lack of that sort of thing that drove me nuts in Filemaker. Also a more rich collection of event handlers does not (in my opinion) complicate things much. I can think of things that would be much more complicated but that don’t add much value (as oposed to GUI event handling which adds lots of value).

This is a list of events an edit field in Microsoft Visual FoxPro can handle,
have a look:
click, doubleclick, destroy, dragdrop, dragover, error, errormessage, gotfocus, init, interactivechange, keypress, lostfocus, message, middleclick, mousedown, mouseenter, mouseleave, mousemove, mouseup, mousewheel, olecompletedrag, oledragdrop, oledragover, olegivefeedback, olesetdata, olestartdrag, programmaticchange, rangehigh, rangelow, rightclick, uienable, valid, when.

A lot of them doesn’t have sense in Servoy, but in my applications I often used a lot of mouse and keyborad events! I think I never used only about 10% of those events.

here is a list of those I feel that make most sense using your list from VFP edit field:
click, doubleclick, rightclick, dragdrop, dragover, gotfocus, interactivechange, keypress, lostfocus, mousedown, mouseenter, mouseleave, mousemove, mouseup, mousewheel, programmaticchange, uienable, valid.

Just my honest opinion.
BTW: Great System. Hope to see it thrive!
Miguel

What about no menu? If one whiches to develop an app with no menu it should be possible.

Yes! I think we must have even this opportunity.

I’am by no means a sofisticated user, but it’s the lack of that sort of thing that drove me nuts in Filemaker. Also a more rich collection of event handlers does not (in my opinion) complicate things much. I can think of things that would be much more complicated but that don’t add much value (as oposed to GUI event handling which adds lots of value).

I agree.
I think mouse and keypress events are very important. They have to do with 99% of user activity!

Hi All,

I just wanted to offer my two cents:

  1. I agree that the keyboard shortcuts and contextual menus are needed (and are on planning) - and will be great additions.

  2. I’m really hard-pressed to come up with 10 examples of how I would use mouseDown, mouseUp, mouseMove, mouseEnter, mouseLeave, mouseWheel. Most of the time when I use those types of events in other environments - I’m writing loads of code that will show tooltips, exchange rollover images, etc. All of which is handled in Servoy as properties of an object, rather than with events.

  3. I would also vote to add a double-click event - but it’s difficult to know exactly how/where it would be used (i.e. on what objects).

  4. The rightClick event might be interesting - but unless I can attach a pop-up menu, it’s really not relevant. And, when the contextual menus come into play (I would assume in developer) - what else would you use it for?

  5. As for uiEnable - since you have to write code to enable/disable objects - you can do whatever you want in the same method. There’s no need for a separate event.

  6. I don’t know when the “valid” event would fire.

  7. I believe that dragDrop is also on the planning - that would be a very good addition as well.

8) programmaticChange is just asking for TROUBLE. Can you imagine trying to debug something that gets changed based on setting a value in a column on a form? Wow. I don’t think this event is helpful at all - in fact maybe even destructive.

  1. We already have onAction (which can be enter key on text fields, click on button press, etc), onFocusGained, onFocusLost, onDataChange, onLoad, onShow, onHide, onRecordSelection, onRecordSave, not to mention the ability to “override” the default menu commands on a form-by-form basis by using the “…cmd” properties on a form (onNewRecordCmd, onOmitRecordCmd, onInvertRecords, onDeleteRecord, onDeleteAllRecords, etc, etc.)

Another thing to consider is that all the previously mentioned products are applications that are VERY TIME CONSUMING to learn, develop and deploy with. Also, they are all database products - none of them are “pure-play” UI builders.

All-in-all - I personally think that Servoy has a great mix of events that are used most of the time.

Just my opinion,

Bob Cusick

I agree with you that in Servoy you cand already build standard GUI.
The problem is simply this: I would like to do something not standard.
I would like the possibility to associate actions on events normally ignored.

Maybe (and in effect is so) some events I listed are not very usefull or have no sense in Servoy even if they could have in other environments.

But the main problem in Servoy is the way it implements events is too simple. They are not true events but simply methods called as a consequence of an event.
Let me explain. Take the onDataChange method: never is passed to it and it doesn’t have the possibility to discard or accept changes (of course you could save previous value and do some testing on current value and do some actions etc…).
Imagine you want to implement an input field accepting only some values based on a calculation or based on the value of other fields. This is not possible with masks, but could be very simple if the field have a KeyPress event where you can choose to accept or discard the key pressed.
A very simple example: date fileds. In date fileds the user have to type, for example, 01-01-2004 and he can’t type 01012004 and let servoy insert the “-” (better: he can but using different input and show mask so during input the date looks like a number and not like a date), or nothing prevent he to type a not number character, or he can’t type 01/01/2004…

Abour mouse events and other events in general, they could be very usefull to implement custom controls without developing beans, or to implement some actions. For example you could implement a puzzle game or, more usefull, an interface to move GUI elements and save
their configuration in the database.

All-in-all - I personally think that Servoy has a great mix of events that are used most of the time.

I agree, but this is not enough for me, and maybe for someone else…
I like Servoy and I choosed Servoy to develop my next software, but I would like the possibility to do more things!

Another “lack” of Servoy is that GUI elements are not object based on true classes. I can’t subclass a GUI element and use it on all my forms.
For example I’d like the possibility to subclass an input field associating to it my standard events or input mask… But this is onther story…