Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiting Keyboard key???

Status
Not open for further replies.

Grube

Programmer
Feb 6, 2007
27
i need to press right arow key, but not with my hand...
this is my code

IF KeyCode() = mKey THEN
SETKEYCODE(0)
LOCK_VAR = 'm'
Display()
Select(?LOCK_VAR)
???
.

after "select" is done my LOCK_VAR field is selected and if i continue to write i'll overwrite already writen "m".
I need to hit right arow so the cursor can be set after the "m" char, and then i can continue to write my word and my first char will remain "m"

now, what should i put in the place of ??? so that application thinks that i have pressed the right arow key?

Thanx :)
 
Hi Grube,

What you asked was how to PRESSKEY(RightKey) but that's not what you should be doing.

Instead, try SELECT(?Lock_Var,2,2) or something close to that.

Note: you can also use
?Lock_Var{prop:SelStart} = n
?Lock_Var{prop:SelEnd} = m

Also FYI: for SelEnd the LRM says "A value of -1 is a special value that indicates that the selection goes to the end of the target control’s text."


HTH,
Mark Goldberg

 
Hi Mark,

thamx a lot! Select(?LOCK_VAR,2,2) did the trick :)
now i have another problem....

i have a listbox above LOCK_VAR field...
the point is: i press m on the keyboard and on the listbox is automaticaly selected item with the first char "m" in its lable. then i continue to write for ex. char "a" and on the listbox is autom. selected item starting with th "ma...". if there is no itel in the listbox starting with "ma" the first item starting with "m" remain selected...

i'm doing a search field...

any ideas how can i do that???

Thanx
 
Hi Grube,

What you're talking about is a locator
Most locators require code, but thankfully the templates are all too happy to generate that code for you.

You can have a single letter locator withouth code
ex: m,m,m cycles through all items starting with m

It's been a while since I've used the templates, but try this:

- Open the window formatter
- Right click on your browse, select Actions
- Click on browse box behavior
- on the default behavior tab, click on Locator Behavior
- select an incremental locator or entry locator
- I'm not sure if you'll need to override the default locator control, and select your Lock_Var or not.....

HTH,
Mark Goldberg
 
hi Mark,

Mark wrote:

"You can have a single letter locator withouth code
ex: m,m,m cycles through all items starting with m "

this is basicaly what i need...do i even need that LOCK_var for my input keys??? can you please explain me how can a do that single letter locator... do i need any hot fields or reset fields...i tried some things with locator behaviour and with conditional behaviours but didn't work properly...

please instruct me thru the process step by step if it's not the problem...i would be very thankful!!!!

all the best,
Igor Grubisic
 
Igor,

If your LIST control is not template based, then make sure that the ,IMM attribute is off and you're done (see Note 1).

Note 1: if you want a field other than the first field to be the locator field, then use the listbox formatting to tag the desired column as the locator (there is a checkbox in the flags section of the listbox formatter.

Note 2: the ,IMM must be ON for page loaded browses



If the LIST control is a template based browse, and you need to have then you should be aware that each tab (each sort order) has it's own locator style.

Step by step directions

- click browse box behavior
(note this can be found in multiple places)
a) via the Extension and Control Templates list
b) on the procedure properties screen
will appear here when the checkbox
"Show on Procedure Properties" from 'a' above
is checked
c) via the window formatter, right click on the control
go to properties->actions tab, or just actions
both are the same place, just 2 ways to get there

- for the default sort order
-- on the default behavior tab
-- click on Locator Behavior
-- select an incremental locator or entry locator

- for other tabs:
-- go to the conditional properties tab
-- highlight the desired tab, click properties
-- click on Locator Behavior
-- select an incremental locator or entry locator



 
Hi Mark,

First of all thank you for your time :9
ok this now wotks, kind of. :)

when my windows start i hit letter "L" and the item starting with the "L" is selected... if i hit "l" again my last item in the list is selected...
If i hit "m" first item starting with "m" is selected. if i hit "m" again next item after that one is selected no matter the first letter.

one more thing...if i hit "m" first item starting with "m" is selested. now if i go with arows up or down and after that hit a letter then the item starting with that letter is selected...
in other words after evry selection i need to go up or down so that my next sears can work prperly...why's that...


oh, and another thing...in conditional Behavior i insert the colum that i need to locate, and i'm aksed for the "key to use"...if i use the of the record it doesn't work...so i kreate new key from that colum that i ned to filter and with that settings i have situation discribed above...
whit this option my record range limit does'n work???

uf....i'll never put this thing to work...
 
Hi!

On the Locator Behaviour Tab of the Default and Conditional Sort Orders, click on Locator Behaviour and set the Locator Type as INCREMENTAL. From your explanation it looks like it is STEP.

Regards
 
Hi!

Also, using Up & Down arrow keys is the ONLY way of RESETTING a Incremental Locator i.e. If you press L, then O and followed by C, it will try to locate for LOC but if you press L, then O, then UP/DOWN arrow key and followed by C and O, it will try to locate for CO.

Regards
 
THans ShankerJ

i get the point, and the locator is workin properly now...
but doing that i have two problema...

1. major problem:

My range field doesn't work ??? i have some single value range limit in the default behaviour...and it is not working???
any ideas???

2. Is it posible somehow to see what am i typing...
i found out that i can use backspace for deleting :)

i tipe LOC and the item starting with the Loc is selected. If i hit backspace, the first item starting with "LO" is selected....cool feature...
now i only need to see what am i typing, and i think that alertkey are not the solution...



thanx guys, you're helping me a lot!
Best regards
 
Hi!

Are you using ABC or Legacy template chain?

Regards
 
Hi!

Better to use Entry Locators.

Look at this thread for info :


If you are using ABC, you can use the property SHADOW or the method GETSHADOW() of the Sort Header object which normally is name something like BRW1::Sort0:Locator for the first (default) sort order, etc.

Regards
 
i think it's ABC temlate...
how can i check that?

if i putentry as a locator type i get lots of errors:

Template error in procedure: SelectARTIKLI
An Entry locator was specified, but no entry control
exists for the free key element! Useing STEP locator
Browse condition: ART:Naziv
Current key: ART:K_ANAZIV
...
and going..... :)

so i need to put in that Shadow thing...where do i put it in embeds list...???


any ideas why my range limit is not working?
 
Hi!

Check Application Properties to see if the Template Chain is ABC or Clarion (Legacy).

Your errors are because you have NOT populated the Entry Control on the Window. You need to define a Local Variable, put it on the Window and then link the entry control to the Locator using Locator Override.

All ranges get converted into Filters for the Browse View except that it gets first priority. So if you have an additional filter set up for the Browse which is INVALID, the whole filter becomes INVALID and is ignored by the Browse View and so ALL records/rows are returned.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top