Re: Using arrow keys as input...
Posted in 1994
jcfowler@wheaton (John C. Fowler) writes: >Ok, here's what I would like to do: > I am trying to make a nice interface for the users when they are selecting >a certain date out of several. Basically, I would like to open a window that >displays 3 of the dates (in chronological order) with the center one >highlighted. If the user doesn't want the one which is highlighted, he/she >can simply press the arrow keys on their keyboard, and the dates will scroll >up and down in the window, until the date that is desired is in the >highlighted area. Then the user presses <ENTER>, and the highlighted date is >chosen. >What I have done: > So far, I have done all the easy stuff such as opening a cursor for the >dates, presenting them in the window nice and fine, all of that kind of stuff. >What I can't figure out how to do, is to have the user press on the arrow >keys, and have that trigger some code to act. I would like something like the >INPUT...ON KEY idea, but I would prefer not to use a screen form. I would >like to detect that the user hit the arrow key, and then scroll through the >dates (via the cursor) corresponding to which arrow key was hit. >What I am doing this with: > Informix 4gl, 5.0 Engine, 4.1 Tools. >Any suggestions??? The user needs to be either at an INPUT, INPUT ARRAY, MENU, or PROMPT for you gather input. You've eliminated the two INPUTs, and I think arrows on a PROMPT might be tricky but you might try COMMAND KEY(UP) and COMMAND KEY(DOWN) from a MENU. I'm not where I can give you same code right now, but I've done stuff similar to this before. email if you need a more specific example. ================ Dennis J. Pimple dennisp@informix.com Informix CSE / Denver 303-850-0210