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

Keyboard Control

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

    Keyboard Control

    I am trying to develop a script to make A5 operable by use of the keyboard to a larger extent, but don't want records to be modeless as this will create all kinds of problems for our operation. Use of the mouse slows down data entry considerably. (Also with the recent OSHA regulation on ergonomics, I think a lot of corporations will be looking for ways to get away from the mouse)
    My idea is to open a form with allow_change set to F and as long as it is set to false trap the keystrokes and use them for enrty control. (pretty much like in A4)If the user selects "E" or "C" then allow_change will be set to T and the onkey events will no longer be valid. Below is what I have tried and it doesn't do anything except not allow changes. What am I doing wrong on the onkey part. I have this attached to the onactivate event of the form. I hope to make this a global function so I can use it with any form. I will use a dummy menu with choices but the choices will really be processed by the onkey event, the menu on screen is just a guide. In writing this I'm also thinking maybe this is the wrong way to go about this and maybe it can be done with a toolbar but it has to be global so it works with any form. Has anyone done something like this? Does anyone know if this capability is in V5 by default? I have heard that V5 will be modal.

    thanks
    Russ

    mode=this.mode_get()
    this.allow_change(.F.)
    if mode="0"
    select
    case ut(a_user.key.value)="C"
    this.allow_change(.T.)
    case ut(a_user.key.value)="E"
    this.allow_change(.T.)
    this.new_record()
    end select
    end if
    if mode="1".or.mode="2"
    select
    case a_user.key.value={F10}
    this.commit()
    end select
    end if
    end

    #2
    RE: Keyboard Control

    check out www.learn alpha.com for an article on how to disable modeless data entry.
    v5 will have an option to disable modeless data entry.

    Comment


      #3
      RE: Keyboard Control

      Russ - I use the attached script on each form on the OnKey event. Save it to FKEYS, then you can copy it the the OnKey event and modify it for the particular form.

      If it doesnt show up well, let me know and I will email you
      a copy

      Lowell

      ============================================================



      ''XBasic global script FKEYS

      ' This script is saved as FKEYS global script so that it may be copied to each form
      ' and modified as required for the particular form.

      ' Script to capture keys and execute fuctions - F2,F3,F9,10,11,12,ESCAPE,

      ' This script assumes a text box on the form (ActiveMode) to show the current active mode.
      ' since CHANGE is not sent untill a change as actually made to a record, CHANGE is forced
      ' to the lable just for information to the user.

      ' To DEBUG, delete the comment (') mark's preceeding the DEBUG commands for the key in question

      dim shared mode as c
      dim old_mode as c



      select
      case a_user.key.value = "{F2}" ' emulates v1 F2 drop down list key
      'DEBUG(1)
      a_user.key.handle = .t.
      sys_send_keys("{%down}") ' send windows command for drop down list
      'DEBUG(0)
      '-------------------------------------------------------------------------------------
      case a_user.key.value = "{F3}" ' trap and ignore F3
      a_user.key.handled = .t. ' but handle the keystroke
      '-----------------------------------------------------------------------------------
      case a_user.key.value = "{F9}" ' NEWREC -set ENTER mode ONLY if in VIEW, start new record
      'DEBUG(1)
      a_user.key.handled = .t. ' if current mode is ENTER/CHANGE,ignore key
      if a_user.key.event = "down" ' remember,if CHANGE has been selected but nothing changed,
      mode = this.mode_get() ' then mode is still VIEW - allow new record
      old_mode = mode

      if mode = "VIEW" then '
      this.allow_change(.t.)
      this.new_record()
      end if

      mode = this.mode_get()
      ActiveMode.text = mode
      Field1.activate()
      end if
      'DEBUG(0)
      '-------------------------------------------------------------------------
      case a_user.key.value = "{F10}" ' set CHANGE mode
      'DEBUG(1)
      a_user.key.handled = .t. ' if current mode is ENTER/CHANGE,ignore key
      if a_user.key.event = "down"
      mode = this.mode_get()
      old_mode = mode

      if old_mode = "VIEW" then
      this.allow_change(.t.)
      ActiveMode.text = "CHANGE" ' show it as being in CHANGE, even though it's still in VIEW
      end if

      mode = this.mode_get() ' but get the REAL mode for later checking

      FIELD1.activate()
      end if
      'DEBUG(0)
      '-------------------------------------------------------------------------
      case a_user.key.value = "{F11}" ' CANCEL current record if mode is not VIEW, leave it in VIEW
      'DEBUG(1)
      a_user.key.handled = .t.
      if a_user.key.event = "down"
      mode = this.mode_get()
      old_mode = mode

      this.cancel()
      this.allow_change(.f.)
      ActiveMode.text = "CANCEL"

      mode = this.mode_get()
      ActiveMode.text= mode
      this.resynch()
      FIELD1.activate()
      end if
      'DEBUG(0)
      '-------------------------------------------------------------------------
      case a_user.key.value = "{F12}" ' SAVE current record if mode is not VIEW
      'DEBUG(1)
      a_user.key.handled = .t. ' if current mode is CHANGE, set back to VIEW
      if a_user.key.event = "down" ' if current mode is ENTER, continue in ENTER mode
      mode = this.mode_get()
      old_mode = mode

      if mode "VIEW" then
      ActiveMode.text = "SAVING"
      this.commit()
      end if

      this.allow_change(.f.)

      if old_mode = "ENTER"
      this.allow_change(.t.)
      this.new_record()
      end if

      mode = this.mode_get()
      ActiveMode.text = mode
      FIELD1.activate()
      end if
      'DEBUG(0)
      '------------------------------------------------------------------------'
      case a_user.key.value = "{ESC}" ' CANCEL current record (same as F11) if mode is not VIEW
      DEBUG(1)
      a_user.key.handled = .t. ' and leave in VIEW
      if a_user.key.event = "down"
      mode = this.mode_get()
      old_mode = mode

      this.cancel()
      ActiveMode.text = "CANCEL"
      this.allow_change(.F.)

      mode = this.mode_get()
      ActiveMode.text = mode
      FIELD1.activate()

      end if
      DEBUG(0)
      '----------------------------------------------------------------------------


      END SELECT



      Comment


        #4
        RE: Keyboard Control

        Thanks to both of you for the info. Both sources are valuable and just what I need as a starting point. I'm pretty new at this and would probably give up (and stay with A4) if not for all the great help by people like you.

        Thanks Again
        Russ

        Comment

        Working...
        X