Error with TypeText and KeyType with SLASH

View: New views
11 Messages — Rating Filter:   Alert me  

Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

|<*TypeText* text="Hello / world"/> or || <*KeyType* keyStroke="SLASH"/>
are not working.
It creates one exception: Invalud key code, code=0x2f

This appears with US101 or JP106 keyboard.

Any idea?

Thanks,
Pierre-Yann

|

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I found the solution, just use VK_DIVIDE instead of VK_SLASH

Please update the keyboad definition


Pierre-Yann Bridé wrote:

> Hi,
>
> |<*TypeText* text="Hello / world"/> or || <*KeyType*
> keyStroke="SLASH"/> are not working.
> It creates one exception: Invalud key code, code=0x2f
>
> This appears with US101 or JP106 keyboard.
>
> Any idea?
>
> Thanks,
> Pierre-Yann
>
> |
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Nobuhiko YASUNAKA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pierre-Yann,

Thank for your report.
But I can't reproduce this issue on my computer.
"Hello / world" works fine under my JP106 keyboard.
I have only JP106 keyboard, so I can't confirm the case of US101,
but I know that the SLASH key is at the same position, so I guess
both of US101 keyboard and JP106 one have same key bindings.

It might be a problem of a locale, or something environment.
Could you tell me your computer's locale (language) setting
and TestSetting.properties (keyBoardType etc...)?

I added a test case as TypeTextRobotEventTest#testExecute4_1().

yasunaka

Pierre-Yann Bridé wrote:

> I found the solution, just use VK_DIVIDE instead of VK_SLASH
>
> Please update the keyboad definition
>
>
> Pierre-Yann Bridé wrote:
>
>> Hi,
>>
>> |<*TypeText* text="Hello / world"/> or || <*KeyType*
>> keyStroke="SLASH"/> are not working.
>> It creates one exception: Invalud key code, code=0x2f
>>
>> This appears with US101 or JP106 keyboard.
>>
>> Any idea?
>>
>> Thanks,
>> Pierre-Yann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I don't understand. The robot isn't emulating the keyboard?

The problem appears on a german windows, with a swiss german keyboard,
on an applet with the local set to "fr" (french).
But I see the workaround on Internet, for a total other problem (nothing
to do  with swingunit or robot) for VK_SLASH and Java.

Also, I remenber from my directx days that some VK are defined on
windows but don't work (VK with synonyme like slash/divide,
period/decimal...)
On msdn, VK_SLASH don't even exist :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
I just find it for korean keyboard :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk5/html/wce50conKoreanKeyboard.asp
also:
**VK_OEM_2** (BF)

    Used for miscellaneous characters; it can vary by keyboard.

    *Windows 2000/XP*: For the US standard keyboard, the '/?' key

Hope it cans help,
Pierre-Yann



Here the settings:
delayRatio=1.0
delayAdjust=0
calmDelay=100
keyBoardType=US101
isScrollArrowPlaceTogether=true
clickInterval=200
singleClickTime=300
doubleClickTime=100
screenInsetTop=0
screenInsetBottom=0
screenInsetRight=0
screenInsetLeft=0
isCapturableWhenExceptionIsThrown=true
useKeywordSubstitution=true
hostsAllowed=localhost
agentWaitTime=1000
port=8999




Nobuhiko YASUNAKA wrote:

> Pierre-Yann,
>
> Thank for your report.
> But I can't reproduce this issue on my computer.
> "Hello / world" works fine under my JP106 keyboard.
> I have only JP106 keyboard, so I can't confirm the case of US101,
> but I know that the SLASH key is at the same position, so I guess
> both of US101 keyboard and JP106 one have same key bindings.
>
> It might be a problem of a locale, or something environment.
> Could you tell me your computer's locale (language) setting
> and TestSetting.properties (keyBoardType etc...)?
>
> I added a test case as TypeTextRobotEventTest#testExecute4_1().
>
> yasunaka
>
> Pierre-Yann Bridé wrote:
>
>> I found the solution, just use VK_DIVIDE instead of VK_SLASH
>>
>> Please update the keyboad definition
>>
>>
>> Pierre-Yann Bridé wrote:
>>
>>> Hi,
>>>
>>> |<*TypeText* text="Hello / world"/> or || <*KeyType*
>>> keyStroke="SLASH"/> are not working.
>>> It creates one exception: Invalud key code, code=0x2f
>>>
>>> This appears with US101 or JP106 keyboard.
>>>
>>> Any idea?
>>>
>>> Thanks,
>>> Pierre-Yann
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Nobuhiko YASUNAKA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pierre-Yann,

RobotEvent is emulating keyboard with mapping data.

The javadoc for KeyEvent class says that Java vertual key
absorbs the difference of phisical keyboard, but it seems it is
available only for the alphabet charactor, not for the non-alphabet
charactor.
To type the key code from a text, we needs keyboard mapping data.

The mapping data is located in src/swingunit/extensions/
and it's file name is KeyBoardType_xxxx.xml, where xxxx is
a keyboard type.

Currently there are only three mapping data, JP106, MAC_JP, and US101.
(US101 is not fully tested.)
The test setting value 'keyBoardType' in TestSetting.properties selects
the keyboard type.

you are using a german window, and it's locale is fr.
So you might need another new mapping data.
If you have time, please consider to contribute your keyboard mapping
data.

To make your keyboard mapping data, maybe following program can help you.

---------------------------
package test;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
  * @author yasunaka
  */
public class EventDump extends JFrame {
        public EventDump() {
                super("EventTestFrame");
                JPanel panel = new JPanel();
                panel.add(new JLabel("Input:"));
                JTextField field = new JTextField();
                field.setColumns(20);
                panel.add(field);
                getContentPane().add(panel);
                setDefaultCloseOperation(EXIT_ON_CLOSE);
                pack();
        }

        public void setupEventQueue() {
                EventQueue original = Toolkit.getDefaultToolkit().getSystemEventQueue();
                original.push(new HookingQueue());
        }
       
        class HookingQueue extends EventQueue {
                protected void dispatchEvent(AWTEvent event) {
                        if(event instanceof KeyEvent) {
                                System.out.println("event = " + event);
                        }
                        super.dispatchEvent(event);
                }
        }
       
        public static void main(String[] args) {
                EventDump frame = new EventDump();
                frame.setupEventQueue();
                frame.setVisible(true);
        }
}

--------------------

Pierre-Yann Bridé wrote:

> Hi,
>
> I don't understand. The robot isn't emulating the keyboard?
>
> The problem appears on a german windows, with a swiss german keyboard,
> on an applet with the local set to "fr" (french).
> But I see the workaround on Internet, for a total other problem (nothing
> to do  with swingunit or robot) for VK_SLASH and Java.
>
> Also, I remenber from my directx days that some VK are defined on
> windows but don't work (VK with synonyme like slash/divide,
> period/decimal...)
> On msdn, VK_SLASH don't even exist :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/WindowsUserInterface/UserInput/VirtualKeyCodes.asp 
>
> I just find it for korean keyboard :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk5/html/wce50conKoreanKeyboard.asp 
>
> also:
> **VK_OEM_2** (BF)
>
>    Used for miscellaneous characters; it can vary by keyboard.
>
>    *Windows 2000/XP*: For the US standard keyboard, the '/?' key
>
> Hope it cans help,
> Pierre-Yann
>
>
>
> Here the settings:
> delayRatio=1.0
> delayAdjust=0
> calmDelay=100
> keyBoardType=US101
> isScrollArrowPlaceTogether=true
> clickInterval=200
> singleClickTime=300
> doubleClickTime=100
> screenInsetTop=0
> screenInsetBottom=0
> screenInsetRight=0
> screenInsetLeft=0
> isCapturableWhenExceptionIsThrown=true
> useKeywordSubstitution=true
> hostsAllowed=localhost
> agentWaitTime=1000
> port=8999
>
>
>
>
> Nobuhiko YASUNAKA wrote:
>
>> Pierre-Yann,
>>
>> Thank for your report.
>> But I can't reproduce this issue on my computer.
>> "Hello / world" works fine under my JP106 keyboard.
>> I have only JP106 keyboard, so I can't confirm the case of US101,
>> but I know that the SLASH key is at the same position, so I guess
>> both of US101 keyboard and JP106 one have same key bindings.
>>
>> It might be a problem of a locale, or something environment.
>> Could you tell me your computer's locale (language) setting
>> and TestSetting.properties (keyBoardType etc...)?
>>
>> I added a test case as TypeTextRobotEventTest#testExecute4_1().
>>
>> yasunaka
>>
>> Pierre-Yann Bridé wrote:
>>
>>> I found the solution, just use VK_DIVIDE instead of VK_SLASH
>>>
>>> Please update the keyboad definition
>>>
>>>
>>> Pierre-Yann Bridé wrote:
>>>
>>>> Hi,
>>>>
>>>> |<*TypeText* text="Hello / world"/> or || <*KeyType*
>>>> keyStroke="SLASH"/> are not working.
>>>> It creates one exception: Invalud key code, code=0x2f
>>>>
>>>> This appears with US101 or JP106 keyboard.
>>>>
>>>> Any idea?
>>>>
>>>> Thanks,
>>>> Pierre-Yann
>>>

--
----------------------------------------------------
Nobuhiko YASUNAKA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, I tested it.
Apparently, character with accent (like é è ö...) are also not supported.
But for the moment, we don't really need them.
If I have time, I will try to look howto handle them.
Pierre-Yann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I played a bit with this keyboard stuff.
I will do the test with french layout, because the accentued charater
are mapped on key with keycode on french keyboard.
Therefore I wanted to create a new KeyboardType xml file. I added a line
in swingunit.xml, and put all modified/new files back in the jar.
But swingunit cannot find my keyboard. What I am missing?

Also, is it possible to have special charaters with Alt for KeyType event?
If yes, a lot of characters can be used
(http://www.forlang.wsu.edu/help/keyboards.asp)

Pierre-Yann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Nobuhiko YASUNAKA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pierre-Yann Bridé wrote:
 > I played a bit with this keyboard stuff.
 > I will do the test with french layout, because the accentued charater
 > are mapped on key with keycode on french keyboard.
 > Therefore I wanted to create a new KeyboardType xml file. I added a line
 > in swingunit.xml, and put all modified/new files back in the jar.
 > But swingunit cannot find my keyboard. What I am missing?

You mean that you extracted the swingunit.jar file
and put your KeyBoardType_FR???.xml file into
swingunit/extensions directory ?

If you do so, The rest thing to do is to set keyboard
type in TestSetting.properties.
(I'm sorry for mistake of the KeyBoardType class javadoc
comment. The keyword of keyboard type is just 'keyBoardType'.
The manual is correct.)

The class to load KeyBoardType xml file is
"swingunit.extensions.KeyBoardType".
KeyBoardType class searches the xml file on the same package,
so you need to put your files on the swingunit/extensions
directory.

Except extracting jar file, you can put your xml file
on swingunit/extensions directory which is relative
from your class path.

And be care that file name is case-sensitive.
The start charactor of KeyBoardType file is upper case, but
the parameter in TestSetting.properties is starting with
lower case.


Pierre-Yann Bridé wrote:
> Also, is it possible to have special charaters with Alt for KeyType event?
> If yes, a lot of characters can be used
> (http://www.forlang.wsu.edu/help/keyboards.asp)

Yes. For example, to type E with ALT key, put
        keyStroke="alt pressed E"
in xml file.
As a modifier, you can use these keys:
shift, control, meta, alt, altGraph, button1, button2, button3.

--
----------------------------------------------------
Nobuhiko YASUNAKA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I resolved my problem with the xml file. Now I can type some accent
characters, it suffisant for my test

You misunderstood  my question. I asked if it is possible to to
something like alt + 146
I tried keyStroke="alt pressed NUMPAD1 pressed NUMPAD4 pressed NUMPAD6",
but it's not working

Pierre-Yann

Nobuhiko YASUNAKA wrote:

> Pierre-Yann Bridé wrote:
> > I played a bit with this keyboard stuff.
> > I will do the test with french layout, because the accentued charater
> > are mapped on key with keycode on french keyboard.
> > Therefore I wanted to create a new KeyboardType xml file. I added a
> line
> > in swingunit.xml, and put all modified/new files back in the jar.
> > But swingunit cannot find my keyboard. What I am missing?
>
> You mean that you extracted the swingunit.jar file
> and put your KeyBoardType_FR???.xml file into
> swingunit/extensions directory ?
>
> If you do so, The rest thing to do is to set keyboard
> type in TestSetting.properties.
> (I'm sorry for mistake of the KeyBoardType class javadoc
> comment. The keyword of keyboard type is just 'keyBoardType'.
> The manual is correct.)
>
> The class to load KeyBoardType xml file is
> "swingunit.extensions.KeyBoardType".
> KeyBoardType class searches the xml file on the same package,
> so you need to put your files on the swingunit/extensions
> directory.
>
> Except extracting jar file, you can put your xml file
> on swingunit/extensions directory which is relative
> from your class path.
>
> And be care that file name is case-sensitive.
> The start charactor of KeyBoardType file is upper case, but
> the parameter in TestSetting.properties is starting with
> lower case.
>
>
> Pierre-Yann Bridé wrote:
>
>> Also, is it possible to have special charaters with Alt for KeyType
>> event?
>> If yes, a lot of characters can be used
>> (http://www.forlang.wsu.edu/help/keyboards.asp)
>
>
> Yes. For example, to type E with ALT key, put
>     keyStroke="alt pressed E"
> in xml file.
> As a modifier, you can use these keys:
> shift, control, meta, alt, altGraph, button1, button2, button3.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Nobuhiko YASUNAKA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pierre-Yann Bridé wrote:
> You misunderstood  my question. I asked if it is possible to to
> something like alt + 146
> I tried keyStroke="alt pressed NUMPAD1 pressed NUMPAD4 pressed NUMPAD6",
> but it's not working

I understand your meanings. But I didn't suppose such
a pattern when I designed the KeyBoardType class.
Currently, there are no way to type a sequence of some
keys while pressing other button.

To work out this issue, I must change the program code.
Let me think about this.

--
----------------------------------------------------
Nobuhiko YASUNAKA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Error with TypeText and KeyType with SLASH

by Pierre-Yann Bridé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't need this feature for the moment. But it will allow to type any
special character. Therefore it can be interesting.

Pierre-Yann

Nobuhiko YASUNAKA wrote:

> Pierre-Yann Bridé wrote:
>
>> You misunderstood  my question. I asked if it is possible to to
>> something like alt + 146
>> I tried keyStroke="alt pressed NUMPAD1 pressed NUMPAD4 pressed
>> NUMPAD6", but it's not working
>
>
> I understand your meanings. But I didn't suppose such
> a pattern when I designed the KeyBoardType class.
> Currently, there are no way to type a sequence of some
> keys while pressing other button.
>
> To work out this issue, I must change the program code.
> Let me think about this.
>
> --
> ----------------------------------------------------
> Nobuhiko YASUNAKA
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...