Skip navigation
Currently Being Moderated

how to make a desktop app ready for tablet

Jul 30, 2012 10:57 PM

Tags: #tablet_pc

I have a flash drawing tool on desktop, and just tried to use it on a windows 7 tablet pc.

 

The system comes with two virtual keyboards, a bigger one that the user has to actively open, and a smaller one that offers itself near many text entry fields (such as system file dialogs)

Now with flash only the bigger one is available, and when I type into it, flash player seems to lose focus.

What would be the best way to handle this situation?

 

Another part of the story: would it be possible to have 3 checkboxes inside the flash app that reflect the state of shift, ctrl, and alt keys and send keypress / keyrelease events such that mouse events report correct keyboard state?

 
Replies
  • Currently Being Moderated
    Jul 31, 2012 7:16 AM   in reply to birnerseff

    The keyboard is an application itself, so yes it will take focus.

     

    Your best option at this point, because a windows 7 tablet is not in the mobile device "realm", is to make your own keyboard. There is some integration with actual mobile devices to pop up specific mobile device keyboards but you can't take advantage of that because Microsoft's aim at tablets is making them "a real computer". So you don't have the mobile device keyboard functionality.

     

    You can find some readily made AS3 keyboards if you google around. Then you control look, feel and focus.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2012 11:15 AM   in reply to birnerseff

    They're easy to find, hope you find one that meets your design needs. You're welcome and good luck!

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 7:19 AM   in reply to birnerseff

    It depends on the keyboard and how it's implemented. Typically you just assign focus and then when you MouseEvent.CLICK a button the keyboard will send the clicked character to the focus. If shift/capslock/etc are pressed then they are toggles until the final button is pressed and then that key combination can be sent.

     

    Sophisticated keyboards can also simply generate events when keys are clicked to simulate keyboard input. If you can't find a freeware plugin to suit your needs, that would end up being the tedious part. Rewiring the keyboard so every character pressed emits the correct keyboard event.

     

    Demo Example

     

    Here is a simple CS4 saved down example of 2 clickable buttons and dispatching keyboard events as well as sniffing for them and doing something different based on what is received. Just the letters A and B with traces.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 1:22 PM   in reply to birnerseff

    It's definitely in your hands to handle a context correctly. If you're using a mouse-based emulated keyboard then you only need to track if something is on or off, but not send that keyboard event for those keys. Keyboard events are probably best left only to keys that actually create a character.

     

    If it's shift, alt, etc then you should just be tracking the on/off state based on what the mouse clicks do and not send a keyboard event at all. When they finally press a key that produces a character, you look at your modifier keys (shift/alt/ctrl) and send the appropriate flags with the new KeyboardEvent. It's then your job to disable all the appropriate buttons again after the character is sent.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 6:04 AM   in reply to birnerseff

    Context if tough to manage in a complex situation no doubt but it's the only sure fire way I see of you doing this while retaining focus. This is all about that, retaining focus. I've made a half dozen keyboards for various projects myself.. I've found no replacements for a custom looking kiosk/app.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 8:26 AM   in reply to birnerseff

    Probably just one of them and it always feels snappier if you use MOUSE_DOWN instead of CLICK unless you plan on handling the situation where a user can press down on something but move their finger off the item to "cancel" that click.

     

    Thanks for posting part of your solution. If you're all done please mark the thread as answered. Good luck!

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 9, 2012 5:24 AM   in reply to birnerseff

    Both are the same thing, just an event. A modifier key event wouldn't do anything on the Flash level besides a true keyboard emitting the event, nothing more. It's up to you to decide if that event is important and do what you need with it. All you really care about is knowing the state of them when a character is added to the TextField so you know how to modify it so all you're interested in is enough events to make sure the character added has the proper modifiers added.

     

    If you're asking if there's a corresponding click handler when a mouse clicks an OS-level on-screen keyboard, no none is generated. Just the equivalent keyboard event fires.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 6:24 AM   in reply to birnerseff

    Always more than one way to skin a cat. Glad you got it working and good luck!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points