Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

On Screen Keyboard Help

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

    On Screen Keyboard Help

    Need a little help from an "Expert". I'm trying to add an on screen keyboard to a couple of our forms using V10 & V11 Desktop. I would like to place buttons on a form and when a user presses for an example buttons labeled, "A" "B" "C" the field with focus would have "ABC" appear with as its value. I have searched the forums for examples with no luck. If someone has an example or could share the code I would place on the individual buttons to make this happen, it would be greatly appreciated. Thank you in advance.
    Last edited by jbk; 01-26-2018, 06:43 PM.

    #2
    Re: On Screen Keyboard Help

    Sounds like you want to send keys as the user presses each button to a string then fill the field with the string value. Do you want to use the enter key to end the string? Is there only the one field you want to fill with the data?

    In your form define a shared variable
    var = ""

    OnInit set the var to blank:
    dim shared var as c = " "

    In each of your buttons:
    dim shared var as c
    var = var+this.text

    Add an OnKey event to trap the Enter key and set your field.value to the var
    Code:
    dim shared var as c
    if (A_USER.KEY.value = "{ENTER}" ) then   
       A_USER.KEY.handled = .T.
       if (A_USER.KEY.event = "down") then
            if  var <> "" then
              yourfieldname.value = var
               topparent.commit()
              yourfieldname.refresh()     
          end if
      end if
    end if
    If instead you want to see what the user has typed as he types it, place the variable on the form and hide the field.
    Haven't tested it, and I'm no expert - but it should give you something to play with...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    Comment


      #3
      Re: On Screen Keyboard Help

      Ok, did test on a dummy form and discovered that if you use the Enter key for your OnKey event then you need to control the navigation if you only have one field on a form. So in the form's properties under restrictions check navigate and continuous enters so the form stays on the current record. Otherwise instead of trapping the keyboard Enter key, I guess you would have a button on the form for that with a similar script:

      Code:
      if  var <> "" then
           yourfieldname.activate()
           yourfieldname.value = var
           topparent.commit()
           yourfieldname.refresh()    
           var = "" 
      end if
      Also you can refresh the field in your button script so the letters appear as the buttons are pushed.

      This is the script I did for each of the abc buttons:

      dim shared vstr as c
      vstr = vstr+this.text
      dummy.value = vstr
      dummy.refresh()
      Last edited by MoGrace; 01-27-2018, 07:35 PM.
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #4
        Re: On Screen Keyboard Help

        MoGrace, thank you for the response. Here is my thoughts: I'd like to put the 26 alphabet letters (A-Z) on individual buttons on a form that contains multiple fields. When a user enter for example the "first name" field, they would press the buttons "J" "O" "H" "N" for a first name of "JOHN", then they would press the "tab" button to enter the next field "last name" and press the buttons "D" "O" "E" for a last name of "DOE". When they have completed there entry of various field data, they would then hit the save button. We started using Microsoft Surface Pro devices which have an optional attached keyboard which some of our employees find cumbersome and want to use the on screen keyboard that is built in to the device but I'm thinking that the use of the on screen keyboard is not going to work with V10/11 desktop applications and I'm trying to see if I can figure out how to add alpha/numeric buttons to our current forms to find a way to use a touch screen on screen keyboard solution. If you or anyone knows of a way to implement MS onscreen keyboard with V10/11 apps, I'm all ears. In the mean time, I'm trying to find a working solution...
        Last edited by jbk; 01-28-2018, 10:09 AM.

        Comment


          #5
          Re: On Screen Keyboard Help

          When the user tabs into the first name field, set a shared var for the active field in the field object's OnArrive event so when the user begins selecting the A-Z buttons that populate the string var, you can put the string value into that field then clear the var in the field's OnDepart event - then reset it with the next field. Even if this is a touch screen it should work when the user is using a mouse or a keyboard.

          You may have noticed that once the user begins pushing the A-Z buttons, the target field loses focus, thus the need to use variables.

          You could also search for 'barcode' and probably find other tips...or maybe someone else will jump in. Otherwise, if you have a sample table and form you could upload, you would probably get more responses.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: On Screen Keyboard Help

            I've attached a sample app with a toolbar key board unzip it to a new folder and open the sales.adb open the sales invoice or inventory entry form there is a button 'keyboard' to open the keyboard. Check the code on the button you don't want to open the keyboard twice. The keyboard will stay open from form to form.

            Allen
            Attached Files

            Comment


              #7
              Re: On Screen Keyboard Help

              Hi Allen
              Well I am amazed! It would be great if you put this in the code archive so we could discuss how you made this toolbar. I've looked at other toolbar strings dozens of times and never could figure out how to write one.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #8
                Re: On Screen Keyboard Help

                Hello Allen (fellow Coloradoan), thanks so much for putting together an example for me. Looks great and I agree with Robin (MoGrace) that you should put this in the code archive for others to possibly implement into there programs. I do however have a question for you, is it possible to rather have than have a dialog box contain the buttons, to simply have individual buttons for each letter / number on a form. I like how you put a "keyboard" button on your form so when a user presses it, the keyboard will appear and if they want to use the there normal computer keyboard they can. My thoughts were along this line so when we use our MS Surface Pros, we can either use the Surface's "type" keyboard or remove that keyboard and use an on screen keyboard similar to yours. I'll add to your example to what I was thinking about with the individual buttons. Thanks again!!!

                Comment


                  #9
                  Re: On Screen Keyboard Help

                  Jon you certainly can put buttons on a form & make it work but I think that it isn't worth the effort. It has to do with the way A5 works when you click a button on a form the field will loose focus you can get back to the last field however if you add a space as the last character A5 will strip out the space so you would have to add the space back before you add the character you want to add. Also if you want to add text to the middle of the field it would be much effort the put the cursor in the correct place once you leave the field. It can be done but not easily. With a toolbar focus is not lost the cursor remains where it was. You could create a toolbar docked to the top or bottom of your forms with just a couple of rows. Space on a tablet is at a premium!
                  Allen

                  Comment


                    #10
                    Re: On Screen Keyboard Help

                    Allen, I agree if that is the way an on screen keyboard made up with buttons will work, not work the time. Question for you, I've been messing around with your sample you were so kind to share, and can't seem to figure out out to change the size of the dialog box. I think I can make you sample work but would like to be able to change it's size. Basically I want to make it fit within the size of the tablet's screen which will make it easier to use for guys with bigger hands to use. Also, is there a way to make the keyboard button when clicked show the keyboard and when clicked again hide it?
                    Thanks again... JON

                    Comment


                      #11
                      Re: On Screen Keyboard Help

                      If you click the red X on the keyboard it will close. The size of the dialog is in part dependent on the font size if you goto the Toolbar Appearance tab ( the tabs are on the bottom of the designer) double click the font description & increase the font size try a size of 18. The top row of buttons will be taller & some will be wider. To do the other rows you need to click the 'XD" button on the first tab(in the list of buttons) than click 'Define Xdialog Code button & change the font size number to the same as you did in the first step( you need to do this for each line in the code box). To make the buttons that are bitmaps wider you need a bigger bitmap.

                      I made an error in the keyboard button the is_object() function will not detect an open toolbar change the code to:
                      Code:
                      if ui_modeless_dlg_exist("keyboard")=.f.
                      a5_toolbar_open("keyboard",.t.)  'toolbar is not open so open it
                      else
                      ui_modeless_dlg_close("keyboard")  'toolbar is open so close it
                      end if
                      to open & close the toolbar with the keyboard button
                      Last edited by Allen Klimeck; 02-01-2018, 07:03 PM.

                      Comment

                      Working...
                      X