On Fri, 12 Jun 2009, dave wrote:
> After all the discussion on this matter I see that i have a problem.
> being how to capture user interaction via the keyboard and allowing the user
> to not be forced to use the mouse.
At the moment, the only thing I can think of is that edit_lines take a block
which is triggered when text is added to the contents. I've not tried this,
but I suppose if a tab character is inserted, the block could remove it and
shift focus to the next edit_line. Then that could shift focus on a tab to
a submit button, and a keypress block might be able to pick up a return
there, subject to the interaction of these keypress and edit_line facilities
operating together nicely.
I think one could then type
32946<tab>Fred Bloggs<tab><enter>
to fill in both fields and submit. But this is only running correctly
in my head, which even I wouldn't recommend as a platform for serious
computation!
What do you think?
>
> I have it solved for Linux (well at least on mine with my keyboard) but at
> work i had a few minutes and ran my code on that winXP pro box - total
> failure
> as mentioned in my last message.
>
> So how has other folk dealt with this issue? and do they know if it's
> platform
> independent?
>
> also lastly would using a URL styled approach work with the keyboard?
Don't know, not really grokked that bit of shoes.
>
> Dave.
Hugh
>
> On Wed, 10 Jun 2009 21:11:00 dave wrote:
> > I have a shoes program (below this message) where what i want to do is to
> > allow the user to enter data into 1 of 2 edit_lines.
> >
> > From the user pressing enter i then check which edit_line has something in
> > it and setup parameters for a SQL statement that 's in a class called dbase
> > that's inside a module called sqlite3_calls.
> >
> > this tho is of no importance yet as i cannot capture the enter key!
> >
> > Note I'm only wanting to get 1 of the two edit_lines working then get
> > the
> > other done once i working based on the solution for the 1st one.
> >
> > Currently what happens is that the program runs but when I alt+/ to see the
> > debug window after my shoes screen appears i see a comment saying pressed
> > enter! when in fact i haven't press a dam thing except .
> >
> > did a search on keypress and edit_line and keypress but nothing i saw
> > really gave me any hints.
> >
> > Dave.
> >
> > code as it stands is below.....
> >
> > require "sqlite3_calls.rb"
> >
> > Shoes.app do
> > # extend Dbase #for the purposes isolation I've commented out this line
> >
> > stack :top =>5, :height => 90 do
> > title "Find Customer Info", :align => 'center'
> > end
> >
> > flow :top => 100, height => 70 do
> > para strong "Customer nos"
> > @custno = edit_line :width => 50 :focus
> >
> > para strong 'customer name'
> > @custname = edit_line :width => 270
> > end
> > if keypress = :enter or keypress = "\n"
> > debug 'pressed enter !'
> > if @custno != nil
> > para 'cust number has a value !'
> > # rows = rec_to_find('customers', 'cust_nos', @custno) # please
> > ignore else
> > if @custname != nil
> > para 'cust name has a value !'
> >
> > end
> >
> > end
> > end
> >
> >
> > flow :top => 550 do
> > para strong 'data return shown here!'
> > end
> >
> > end
>