sachinbaan
23rd January 2015, 09:05
on putting value in text field, focus event calls, but key press event is not executing. pls help on this.


field.emno:
on.input:
while TRUE
next.event(event)
on case evt.type(event)
case EVTKEYPRESS:
on case evt.keypress.key( event)
default:
message("Key Pressed")
endcase
on case evt.keypress.state( event)
default:
message("Key Press State")
endcase
break

case EVTTABSELECT:
on case evt.tab.index( event)
default:
message("Tab select")
endcase
break

case EVTCHANGEFOCUS:
on case evt.focus.object( event )
default:
message("Change Focus")
endcase
break
case EVTSETFOCUS:
on case evt.focus.key( event )
default:
message("Set Focus")
endcase
break

endcase
ENDWHILE

bhushanchanda
23rd January 2015, 14:42
Hi,

I am not sure if it will be triggered from on.input. As this section is triggered when the focus is removed. I guess you need to create a 3GL program and then execute it as a background process for the current session and then you might be able to catch the events. Not sure if that's your requirement, but you can give it a try.

Also,

Note:- The event paradigm is used in both ASCII and graphical programming environments. But some events are relevant only in graphical environments (for example, mouse events).

So, may be that event is not available for GUI mode.

I guess, it will work only for programmable dialog. Though haven't tried it.

vamsi_gujjula
27th January 2015, 14:22
BTW what is the exact requirement ??

sachinbaan
28th January 2015, 06:01
hi vamsi,

requirement is, we have one session where we have some fields out of which one field is for "User psno" which is going to get populated from external device "Card reader", so user is not allowed to enter psno manually (Using keyboard) so we need to disable input from keyboard.

bhushanchanda
28th January 2015, 08:42
Hi,

Check this thread (http://www.baanboard.com/baanboard/showthread.php?t=26035). Hope it helps.