Shift + Spacebar

I need to perform a "Shift + Spacebar" command.

I have tried the following:
TypeText ShiftDown, Space, ShiftUp
TypeText ShiftKey, Space

However eggPlant seems to not apply the shift to the spacebar.

Any tips?

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    Both of those lines should produce what you are asking for. What doesn't appear to be working?

    The only thing I can think is that somehow your SUT is interpreting it differently when it's pressed locally. For example on some systems typing Shift+Tab will actually generate the back-tab character (which has it's own UNICODE character).

    Perhaps you are looking for something similar and it's not happening
  • I still think there's something weird/unclear/undocumented about eggPlant's use of the shift keys.

    Consider this example:
    TypeText ShiftDown, "123", ShiftUp, "123"

    If I were to perform this action manually, I would expect to see:
    !@#123

    However, eggPlant produces:
    123123

    I'm concerned a similar situation is occurring with the Spacebar.

    To further complicate this weirdness, check out this online Microsoft Keyboard Ghosting tool:
    http://www.microsoft.com/appliedsciences/KeyboardGhostingDemo.mspx

    If I try my example above on this Ghosting Keyboard, I can visually confirm that the Shift Key is indeed held down while pressing the "123" sequence. However, instead of "!@#" eggPlant produces "123". Strange.

    And if I were to try:
    TypeText ShiftDown, keypad1, keypad2, keypad3, ShiftUp, keypad1, keypad2, keypad3

    I can visually confirm that eggPlant releases the Shift Key automatically for keypad presses... Before I tell it to.

    So eggPlant is definitely doing some extra "shift key logic" behind the scenes.

    I have a gut feeling this extra logic is mucking up my Shift+Space hotkey...
  • JonathanOSXJonathanOSX ForumAdmin admin
    I can clarify at least part of what you are seeing.
    TypeText ShiftDown, "123", ShiftUp, "123"
    

    VNC is attempting to inject characters not keystrokes. So in the line above eggPlant is very explicitly telling VNC that we want to type a 123 (regardless) of the shift key states. So the VNC server is injecting those numbers. This is important because on some keyboard (e.g. French) you HAVE to hold shift to type the numbers.

    However, the bit with the Keypad keys seems like it might be an issue however.

    There isn't a "Shift-Space" character that I'm aware of but it might be a similar thing where Shift-Space is supposed to actually produce a different character but it's only a regular space being sent across.
  • VNC is attempting to inject characters not keystrokes.
    So could this be the explanation then for the "Shift+Spacebar" issue too? VNC is injecting the "Space" character and not the keystroke (as intended)
  • JonathanOSXJonathanOSX ForumAdmin admin
    Quite possibly, that has been the case before with Shift-Tab, because there actually exists a BackTab character, so we added code to take care of that.

    But as I mentioned, there really isn't a "Shift-Space" character that I'm aware of. So it boils down to what the target application is looking for. The Shift key IS down and the Space key gets "inserted". My guess is that if you ran your application via any regular VNC viewer you would similarly have a problem typing that keyboard shortcut

    If that's NOT the case then it's definitely something we can fix in eggPlant, but if so then it sounds like the way the target application is picking up the events isn't going to let you hit that shortcut via VNC.
  • I guess I should explain my actual problem at-hand.
    Maybe there's a simpler solution I'm missing:

    I have a standard Java Combobox.
    In it, let's say I have several items:
    [Apples, Bag of Chips, Baked Beans, Baked Potato, Grapes, Lemons, Limes, Pizza]

    My user's eggPlant script will Click the Combobox, and then TypeText the desired selection, and then hit Enter.

    Works great for "Apples", "Grapes", "Lemons", "Limes", "Pizza".

    Unfortunately, standard Java Comboboxes also interpret a Spacebar as Enter.

    So when I tell it to select "Baked Potato", it does this mess:
    eggPlant types "Baked".
    The Combobox highlights "Baked Beans" since that's the first alphabetical "Baked" item. So far this is expected.
    eggPlant types a Space.
    The Combobox selects "Baked Beans". Whoops.
    eggPlant types "Potato"
    The Combobox abandons "Baked Beans" and now highlights "Pizza" because that's the closest "P" entry.
    eggPlant types Enter.
    The Combobox now has "Pizza" selected.

    This stage tripped us up for quite a while. We actually went down the path of writing a VERY complex eggPlant routine that attempted to cycle through all the items, ReadText, and compare. But this was horribly inefficient and a tad embarrassing.

    Breakthrough though, because it was discovered recently that the Java Combobox interprets "Shift+Space" as the Space character. Awesome.

    So if I manually click the Combobox, type "Baked[Shift+Spacebar]Potato", it selects it just fine. Groovy.

    If I just tell eggPlant to replace all "Spaces" with "Shift+Spacebar" and I should be good to go. Or so I thought.

    And here we are.

    If I try to tell eggPlant to
    TypeText "Baked", ShiftDown, Space, ShiftUp, "Potato"

    the Combobox is still registering the "Space" as an "Enter", and I've got "Pizza" all over again.

    The frustrating part is this works wonderfully manually. It's a matter of getting eggPlant/VNC to execute these hotkeys correctly...
  • JonathanOSXJonathanOSX ForumAdmin admin
    It's always helpful to discuss the concrete situation. Unfortunately it seems like it might be a conflict in the core of Java with how VNC works.

    I would recommend trying it through a live VNC session (either with eggPlant or a generic VNC Viewer). If it works then we have an eggPlant problem that we can address. If it does NOT work then the only option is to try another VNC server on your SUT. If any servers allow this control (through a live VNC connection) then we should be able to make eggPlant follow suit. If not it's really a problem at the VNC Server or Java level (depending on who you ask).
  • DJSeebsDJSeebs Member
    Problem solved.

    Long story short: Older versions of RealVNC Server have a known issue sending the Shift+Space command.
    [http://www.realvnc.com/products/vnc/documentation/4.2/known-bugs/
    Issue #85]
    This was NOT an eggPlant issue.

    Updated to a newer RealVNC version and the issue was resolved.

    Thanks JonathanOSX for your patience and support.
  • JonathanOSXJonathanOSX ForumAdmin admin
    Fantastic! Glad to know the problem is resolved.
Sign In or Register to comment.