Caan't send a SHIFT-INSERT or SHIFT-DELETE keystroke?

20 views
Skip to first unread message

Chris Merrill

unread,
Oct 20, 2016, 11:09:58 AM10/20/16
to TestFX
I'm having trouble with these two specific key combinations. I have no trouble with CONTROL-INSERT or CONTROL-DELETE...or with SHIFT-A, SHIFT-B, etc.

For the successful case (CONTROL-INSERT)

push(CONTROL, INSERT);

yields:

control down = true
key code = CONTROL
control down = true
key code = INSERT

But for the failing cases (SHIFT-INSERT and SHIFT-DELETE)

push(SHIFT, INSERT);
-- or --
press(SHIFT).push(INSERT).release(SHIFT);

yields:

control down = false
key code = SHIFT
control down = false
key code = INSERT
control down = false
key code = SHIFT

Is there something special I need to know about using the shift key in TestFx with other special (non-character) keys?

Any help would be much appreciated!

TIA,
Chris


BTW, the wiki page mentions the hold() method, but that seems to no longer exist. I almost updated the wiki page, but I'm not confident my understanding of push() vs press() is correct. The javadoc doesn't offer a differentiation either.

Chris Merrill

unread,
Oct 20, 2016, 1:40:26 PM10/20/16
to TestFX
I'm sorry, I copied the wrong snippet. That second example should have read:



But for the failing cases (SHIFT-INSERT and SHIFT-DELETE)

push(SHIFT, INSERT);
-- or --
press(SHIFT).push(INSERT).release(SHIFT);

yields:

shift down = true
key code = SHIFT
shift down = false
key code = INSERT
shift down = true
key code = SHIFT

Chris Merrill

unread,
Oct 20, 2016, 1:50:59 PM10/20/16
to TestFX
One final bit of information: If I replace the key command lines in my unit test and instead :
1) execute a sleep
2) manually press SHIFT-INSERT on physical keyboard
3) wait for sleep to finish

my unit test passes and this output confirms the expected behavior:

shift down = true
key code = SHIFT
shift down = true
key code = INSERT


So I'm now pretty confident this is a TestFX problem, but I've been unable to determine the cause. I tried stepping into the code, but that gets a little tricky after the shift-key-down event is emulated - controlling the debugger is a little challenging with the SHIFT key held down :)

TIA!
Chris




On Thursday, October 20, 2016 at 11:09:58 AM UTC-4, Chris Merrill wrote:

Chris Merrill

unread,
Oct 23, 2016, 10:14:48 AM10/23/16
to TestFX
Filed a bug report on this with a full example:  https://github.com/TestFX/TestFX/issues/310


On Thursday, October 20, 2016 at 11:09:58 AM UTC-4, Chris Merrill wrote:
Reply all
Reply to author
Forward
0 new messages