Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2888 > unrolled thread

keypressed of up arrow no

Started by"Jack" <jack@THRWHITE.remove-dii-this>
First post2011-04-27 15:41 +0000
Last post2011-04-27 15:41 +0000
Articles 10 — 4 participants

Back to article view | Back to comp.lang.java.gui


Contents

  keypressed of up arrow no "Jack" <jack@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
    Re: keypressed of up arro "KaL" <kal@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
      Re: keypressed of up arro "Jack" <jack@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
    Re: keypressed of up arro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
      Re: keypressed of up arro "Jack" <jack@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
        Re: keypressed of up arro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
        Re: keypressed of up arro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
          Re: keypressed of up arro "Jack" <jack@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
            Re: keypressed of up arro "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000
              Re: keypressed of up arro "Jack" <jack@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000

#2888 — keypressed of up arrow no

From"Jack" <jack@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
Subjectkeypressed of up arrow no
Message-ID<47680183$0$850$ba4acef3@news.orange.fr>
  To: comp.lang.java.gui
Hi,

i have a Swing problem, i don't receive the "keypressed event" for "up arrow" when the Ctrl key is pressed. I have one
computer for which i receive the keyPressed, but another computer the java program doesn't work.

I keep "Ctrl" key pressed, and i type the up arrow key.

On the "working" computer:

keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_UP, modifiers = Ctrl


On the "not working" computer:

keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
keyPressed keyCode = VK_CONTROL, modifiers = Ctrl

The "up" key is not seen. Do i misuse the Java API, or do you know any bug wich could be the cause of that behavior?


The source code:
======================================
package lc;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;

public class ListeClavier {

	public static void main(String[] args) {
		System.out.println("java.version : " + System.getProperty("java.version"));
		
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		DefaultListModel model = new DefaultListModel();
		model.addElement("a");
		model.addElement("b");
		model.addElement("c");
		
		JList list = new JList(model);
		
		list.addKeyListener(new KeyAdapter() {

			public void keyPressed(KeyEvent e) {
				String key;
				switch (e.getKeyCode()) {
				case KeyEvent.VK_UP: key = "VK_UP"; break;
				case KeyEvent.VK_DOWN: key = "VK_DOWN"; break;
				case KeyEvent.VK_CONTROL: key = "VK_CONTROL"; break;
				default: key = "" + e.getKeyCode();
				}
				System.out.println("keyPressed keyCode = " + key + ", modifiers = " + KeyEvent.getKeyModifiersText(e.getModifiers()));
			}
			
		});
		JScrollPane scrollPane = new JScrollPane(list);
		
		frame.setContentPane(scrollPane);
		frame.setVisible(true);
		
		
	}

}
=====================================

Thnaks for any help

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#2890 — Re: keypressed of up arro

From"KaL" <kal@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<NUU9j.19036$8j3.10264@tornado.fastwebnet.it>
In reply to#2888
  To: comp.lang.java.gui
Il Tue, 18 Dec 2007 18:21:53 +0100, Jack ha scritto:

> Hi,
> 
> i have a Swing problem, i don't receive the "keypressed event" for "up
> arrow" when the Ctrl key is pressed. I have one computer for which i
> receive the keyPressed, but another computer the java program doesn't
> work.
> 
> I keep "Ctrl" key pressed, and i type the up arrow key.
> 
> On the "working" computer:
> 
> keyPressed keyCode = VK_CONTROL, modifiers = Ctrl keyPressed keyCode =
> VK_CONTROL, modifiers = Ctrl keyPressed keyCode = VK_CONTROL, modifiers
> = Ctrl keyPressed keyCode = VK_CONTROL, modifiers = Ctrl keyPressed
> keyCode = VK_CONTROL, modifiers = Ctrl keyPressed keyCode = VK_CONTROL,
> modifiers = Ctrl keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
> keyPressed keyCode = VK_UP, modifiers = Ctrl
> 
> 
> On the "not working" computer:
> 
> keyPressed keyCode = VK_CONTROL, modifiers = Ctrl keyPressed keyCode =
> VK_CONTROL, modifiers = Ctrl keyPressed keyCode = VK_CONTROL, modifiers
> = Ctrl keyPressed keyCode = VK_CONTROL, modifiers = Ctrl keyPressed
> keyCode = VK_CONTROL, modifiers = Ctrl keyPressed keyCode = VK_CONTROL,
> modifiers = Ctrl keyPressed keyCode = VK_CONTROL, modifiers = Ctrl
> 
> The "up" key is not seen. Do i misuse the Java API, or do you know any
> bug wich could be the cause of that behavior?
> 
> 
> The source code:

> [...omitted code...]

> Thnaks for any help

Maybe this combination is already bound by another process...
I'm just guessing,
K'

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2893 — Re: keypressed of up arro

From"Jack" <jack@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<4768dadf$0$875$ba4acef3@news.orange.fr>
In reply to#2890
  To: comp.lang.java.gui
> Maybe this combination is already bound by another process...
> I'm just guessing,

Thanks, it was Winamp :p

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2891 — Re: keypressed of up arro

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<d5hhm39ldhmsuf4t238v7pcak39au53mnk@4ax.com>
In reply to#2888
  To: comp.lang.java.gui
On Tue, 18 Dec 2007 18:21:53 +0100, Jack <mlskqd@poqsd.com> wrote,
quoted or indirectly quoted someone who said :

>The "up" key is not seen. Do i misuse the Java API, or do you know any bug wich could be the cause of that behavior?

Using Keyplayer I see Ctrl-Up Arrow see
http://mindprod.com/products.html#KEYPLAYER


[E:\sys]keyplayer
At keyPressed
 ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="&" 38  cooked KeyChar="."
65535
At keyReleased
 ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="&" 38  cooked KeyChar="."
65535
At keyPressed
 ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="."
65535 CTRL
_MASK
At keyPressed
 ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="&" 38  cooked KeyChar="."
65535 CTRL
_MASK
At keyReleased
 ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="&" 38  cooked KeyChar="."
65535 CTRL
_MASK
At keyReleased
 ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="." 17  cooked KeyChar="."
65535
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2892 — Re: keypressed of up arro

From"Jack" <jack@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<4768d512$0$904$ba4acef3@news.orange.fr>
In reply to#2891
  To: comp.lang.java.gui
Roedy Green a ocrit :
> On Tue, 18 Dec 2007 18:21:53 +0100, Jack <mlskqd@poqsd.com> wrote,
> quoted or indirectly quoted someone who said :
> 
>> The "up" key is not seen. Do i misuse the Java API, or do you know any bug wich could be the cause of that behavior?
> 
> Using Keyplayer I see Ctrl-Up Arrow see
> http://mindprod.com/products.html#KEYPLAYER
> 
> 
> [E:\sys]keyplayer
> At keyPressed
>  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="&" 38  cooked KeyChar="."
> 65535
> At keyReleased
>  ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="&" 38  cooked KeyChar="."
> 65535
> At keyPressed
>  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="."
> 65535 CTRL
> _MASK
> At keyPressed
>  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="&" 38  cooked KeyChar="."
> 65535 CTRL
> _MASK
> At keyReleased
>  ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="&" 38  cooked KeyChar="."
> 65535 CTRL
> _MASK
> At keyReleased
>  ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="." 17  cooked KeyChar="."
> 65535

On the "not working" computer, i have this:

At keyPressed
  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="." 65535 CTRL_MASK
At keyPressed
  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="." 65535 CTRL_MASK
At keyPressed
  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="." 65535 CTRL_MASK
At keyPressed
  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="." 65535 CTRL_MASK
At keyPressed
  ID@1 KeyEvent.KEY_PRESSED   raw KeyCode="." 17  cooked KeyChar="." 65535 CTRL_MASK
At keyReleased
  ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="&" 38  cooked KeyChar="." 65535 CTRL_MASK
At keyReleased
  ID@2 KeyEvent.KEY_RELEASED  raw KeyCode="." 17  cooked KeyChar="." 65535


So the VK_UP (38) keyReleased is received, but not the keyPressed

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2894 — Re: keypressed of up arro

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<478jm35820hmqi2mb0pjraojtdbb6infjv@4ax.com>
In reply to#2892
  To: comp.lang.java.gui
On Wed, 19 Dec 2007 09:24:32 +0100, Jack <mlskqd@poqsd.com> wrote,
quoted or indirectly quoted someone who said :

>So the VK_UP (38) keyReleased is received, but not the keyPressed

I suspect your OS is not passing the proper keystrokes on.  You might
try updating, reinstalling, or changing your keyboard driver.  

This a longshot, but try a different keyboard.

You might also look for some non-Java tools to track keystrokes.
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2895 — Re: keypressed of up arro

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<63ajm35j1m3ce504tti3fqp3jt0k61te44@4ax.com>
In reply to#2892
  To: comp.lang.java.gui
On Wed, 19 Dec 2007 09:24:32 +0100, Jack <mlskqd@poqsd.com> wrote,
quoted or indirectly quoted someone who said :

>> http://mindprod.com/products.html#KEYPLAYER

I just posted a new version at 
 http://mindprod.com/products2.html#KEYPLAYER

It display hex as well.
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2896 — Re: keypressed of up arro

From"Jack" <jack@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<476a3609$0$851$ba4acef3@news.orange.fr>
In reply to#2895
  To: comp.lang.java.gui
Roedy Green a ocrit :
> On Wed, 19 Dec 2007 09:24:32 +0100, Jack <mlskqd@poqsd.com> wrote,
> quoted or indirectly quoted someone who said :
> 
>>> http://mindprod.com/products.html#KEYPLAYER
> 
> I just posted a new version at 
>  http://mindprod.com/products2.html#KEYPLAYER
> 
> It display hex as well.

Thanks, but it was Winamp.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2897 — Re: keypressed of up arro

From"Lew" <lew@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<TOCdnU3fQN878_fanZ2dnUVZ_tPinZ2d@comcast.com>
In reply to#2896
  To: comp.lang.java.gui
Jack wrote:
> Roedy Green a |-crit :
>> On Wed, 19 Dec 2007 09:24:32 +0100, Jack <mlskqd@poqsd.com> wrote,
>> quoted or indirectly quoted someone who said :
>>
>>>> http://mindprod.com/products.html#KEYPLAYER
>>
>> I just posted a new version at 
>>  http://mindprod.com/products2.html#KEYPLAYER
>>
>> It display hex as well.
> 
> Thanks, but it was Winamp.

What do you mean, exactly?

-- 
Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2898 — Re: keypressed of up arro

From"Jack" <jack@THRWHITE.remove-dii-this>
Date2011-04-27 15:41 +0000
SubjectRe: keypressed of up arro
Message-ID<476a7537$0$859$ba4acef3@news.orange.fr>
In reply to#2897
  To: comp.lang.java.gui
Lew a |-crit :
> Jack wrote:
>> Roedy Green a |-crit :
>>> On Wed, 19 Dec 2007 09:24:32 +0100, Jack <mlskqd@poqsd.com> wrote,
>>> quoted or indirectly quoted someone who said :
>>>
>>>>> http://mindprod.com/products.html#KEYPLAYER
>>>
>>> I just posted a new version at 
>>>  http://mindprod.com/products2.html#KEYPLAYER
>>>
>>> It display hex as well.
>>
>> Thanks, but it was Winamp.
> 
> What do you mean, exactly?

Winamp was intercepting Ctrl+Up. I guess is must be "next song"...

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web