Announcement

Collapse
No announcement yet.

Problem with Visi QWERTY keyboard

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16


    Why didn't you post this in the original thread, very confusing to everyone.

    Anyway, there's a simple example attached.

    Attached files kbcallusdProg.zip (2.6 KB)
    Mark

    Comment


    • #17


      Thank you for the help,

      The example you sent has help me, and for the most part it is doing what I want. There is something going on that I still am having trouble with however. When one of my functions returns, the keyboard is redrawn but the initial key that called that program is redrawn in the down state. I have tried from the main program and the called function to have the key return in the up state by using:
      img_SetWord(hndl, 2,IMAGE_INDEX, 0);
      or img_Lighten(hndl, 2) ;
      with img_Show(hndl, 2) ;
      or refreshstate(ikeyboard1, okeyboard1) ;

      but this causes the screen to be redrawn twice and the key is still drawn in the down position. What's odd is that this only happens on one of the keys. The "2" key calls a 7400 kb program that has a lot of input choices. Everything seems to work fine with it, and it returns to the Main Keyboard just like I want it to.
      Can you think of something that I am overlooking?

      Again thank you for your help,

      Mark

      Comment


      • #18


        I would expect all keys are doing that as the handler triggers on 'down' so the key will still be down for a moment or two after returning from the function.

        You could try calling kbUp() before refreshstate(), but I'm not sure that that will not have other consequences.
        Mark

        Comment


        • #19


          Is there a turorial about how using the keyboard widget for filling a string? I look at the kbcall project example provided above and I feel lost with so few comments.

          1) I do not catch how I get the value.
          2) the Kbhandler(var Key)
          args[0]:=1; //Is it a way to set a default value even if we do provide the function with a value?
          args[1]:=Key;

          3) What is the role of func kbHandler(), funcx() and kbDown and KbUp?
          4) Where is declared KbButtons?

          And what about:
          file_Exec("chfunc.4fn", args); // could use file_Run, but then all allocate memory would need to
          be recreated (eg image controls) and reinitialised (eg img_Setword)


          Sorry for sending my question before experimenting more, but need to work on that tomorrow and tomorrow will be the night for some of you!

          Thanks,

          Comment


          • #20


            Have a look at the 'Keyboard' VisI sample and read the comments in it, that describes a bit more about how it works and should answer most of your questions

            Also the 4DGL programmers reference, specifically str_PutByte, for how to append into a string (which is how it's done in kbfunc)

            Not sure why you are looking inside the source to understand it, Assuming you came across it in bigdemo and it how you how to use it there and/or in the comments at the top.

            Again the programmers reference describes file_Exec
            Mark

            Comment


            • #21


              Implementing a keyboard in my project,

              I had to find a "KeyboardConst.inc" as well as KBroutine.inc to include.
              But I had to comment // var disk, hndl ; in KeyboardConst.inc because it said already declared as global.
              Also, I had to declare and manage a 2nd handle, and had to manage 2 types of calls for imgTouched:=img_Touched(h,-1); where h can be either of those for:
              hndl := file_LoadImageControl("Remote05.dat", "Remote05.gci", 1);
              hKB := file_LoadImageControl("Keyboard.dat", "Keyboard.gci", 1);

              1) Even if the display is perfectly calibrated, clicking a key, it gets a key like 2nd or 3rd on the right and one row up.

              2) typed keys appear redraw above the keyboard.

              3) clicking in some places makes the display black and not responding anymore.

              4) Typing some keys, Make display a 2nd keyboard smaller and a bit lower in the display

              Maybe some problems come from the fact I switched the display LANDSCAPE for that menu.

              This widget semms complicated and difficult to control the processus without knowing all the ins and out.
              So unless we solve it, I will need to implement my own keyboard (like reinvent the wheel).

              Comment


              • #22


                The xxxxConst.inc files are generated as part of the build process for the program being built, I can't imagine any need to include another program's xxxxConst.inc.

                Similarly if you are just file_Execing a function there is no need to open it's files in your main routine, see the way bigdemo calls KBFunc.

                It would seem you are confusing the whole process.

                Zip up and attach your whole project, so we can get some idea of what you are trying to do.
                Mark

                Comment


                • #23


                  The need comes from the fact that the compiler says it cannot find it.
                  But anyway, I think it is complicated enough, will try my own simple keyboard first. Thanks.

                  Comment

                  Working...
                  X