Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001386 [Squeak] VM minor always 06-28-05 18:11 04-08-10 14:17
Reporter dvf View Status public  
Assigned To lewis
Priority normal Resolution open  
Status confirmed   Product Version trunk
Summary 0001386: [Bug][?] Don't see F1-F10 keys in Linux, F11, F12 wrong.
Description I was trying out the debugger keyboard bindings when I noticed this -

I do Sensor kbdTest, press F1-F10, nothing happens at all. When I press
an F key above 10, i get " 0 0" printed. Is this a VM feature? it
doesn't appear to my window manager or X itself (changed window manager,
Eterms do print something when F1 is pressed).

I anybody else seeing this? Ideas?

Daniel
PS.
VM: unix - Squeak3.4 of 1 March 2003 [latest update: #5170]
Image: Squeak3.6beta [latest update: #5352]
Additional Information
Attached Files

- Relationships

- Notes
(0001682 - 2315 - 3153 - 3193 - 3193 - 3193 - 3193)
KenCausey
06-28-05 18:14

Ned Konz <ned@bike-nomad.com> followed up with:

"> I do Sensor kbdTest, press F1-F10, nothing happens at all.

Yes, the VM doesn't pass function keys up to Squeak.

> When I
> press an F key above 10, i get " 0 0" printed. Is this a VM
> feature? it doesn't appear to my window manager or X itself
> (changed window manager, Eterms do print something when F1 is
> pressed).
>
> I anybody else seeing this? Ideas?

Yes, I see it too.

I suspect this is a side-effect of how we're translating key strings
in the VM.

If you compile with DEBUG_EVENTS defined you'll see the translation.

What we're doing is calling XLookupString().
Then if it doesn't come up with a character code, we're trying to
translate the symbolic keyname.

Now in this case, XLookupString() results in no bytes. Output below
from xev (1):

KeyPress event, serial 27, synthetic NO, window 0x3400001,
    root 0x7c, subw 0x0, time 2167463, (280,699), root:(286,719),
    state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes: ""

KeyPress event, serial 27, synthetic NO, window 0x3400001,
    root 0x7c, subw 0x0, time 2170356, (280,699), root:(286,719),
    state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes: ""

But... there's special logic in there for Sun keyboards.

And the Sun keyboards use the same keysyms as F11 and F12...

#define XK_F11 0xFFC8
#define XK_L1 0xFFC8
#define XK_F12 0xFFC9
#define XK_L2 0xFFC9
#define XK_F13 0xFFCA
#define XK_L3 0xFFCA

And the special logic says (in translateCode()):

# define ALT (8<<8)
  switch (symbolic)
    {
    case XK_L1: return ALT+'.'; /* stop */
    case XK_L2: return ALT+'j'; /* again */

So in the case of (for instance) F11, translateCode() returns
0x0800+0x2e, or 0x82e.

Then the return value of translateCode() is used as a lookup in a
table with 256 entries...

  if (nConv == 0 && (charCode= translateCode(symbolic)) < 0)
    return -1; /* unknown key */
  if ((charCode == 127) && mapDelBs)
    charCode= 8;
  if (charCode >= 128)
    charCode= X_to_Squeak[charCode];
  return charCode;

So we get whatever is 0x72e bytes past the end of the table.

Which is apparently 0.

This is probably a bug."
 
(0001683 - 4480 - 7482 - 7602 - 7673 - 7673 - 7673)
KenCausey
06-28-05 18:19

I checked this out in 3.9a-6668 and see related behavior. However in my case when I hit F11 or F12 I get a debugger that claims there has been a 'User Interrupt' and the resulting debugger gives me errors. Here is the debug log though:

The error report: 28 June 2005 10:11:59 am

VM: unix - a SmalltalkImage
Image: Squeak3.9alpha [latest update: 0006667]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/ken/projects/squeak/task2
Trusted Dir /home/ken/projects/squeak/task2/secure
Untrusted Dir /home/ken/projects/squeak/task2/My Squeak

EventSensor>>processEvent:
    Receiver: an EventSensor
    Arguments and temporary variables:
<<error during printing>
    Receiver's instance variables:
        mouseButtons: 0
        mousePosition: 570@479
        keyboardBuffer: a SharedQueue
        interruptKey: 2094
        interruptSemaphore: a Semaphore(a Process in EventSensor(InputSensor)>>userInte...etc...
        eventQueue: a SharedQueue
        inputSemaphore: a Semaphore()
        lastEventPoll: 185422
        hasInputSemaphore: true

EventSensor>>fetchMoreEvents
    Receiver: an EventSensor
    Arguments and temporary variables:
<<error during printing>
    Receiver's instance variables:
        mouseButtons: 0
        mousePosition: 570@479
        keyboardBuffer: a SharedQueue
        interruptKey: 2094
        interruptSemaphore: a Semaphore(a Process in EventSensor(InputSensor)>>userInte...etc...
        eventQueue: a SharedQueue
        inputSemaphore: a Semaphore()
        lastEventPoll: 185422
        hasInputSemaphore: true

EventSensor>>primKbdPeek
    Receiver: an EventSensor
    Arguments and temporary variables:
<<error during printing>
    Receiver's instance variables:
        mouseButtons: 0
        mousePosition: 570@479
        keyboardBuffer: a SharedQueue
        interruptKey: 2094
        interruptSemaphore: a Semaphore(a Process in EventSensor(InputSensor)>>userInte...etc...
        eventQueue: a SharedQueue
        inputSemaphore: a Semaphore()
        lastEventPoll: 185422
        hasInputSemaphore: true

EventSensor(InputSensor)>>keyboardPressed
    Receiver: an EventSensor
    Arguments and temporary variables:

    Receiver's instance variables:
        mouseButtons: 0
        mousePosition: 570@479
        keyboardBuffer: a SharedQueue
        interruptKey: 2094
        interruptSemaphore: a Semaphore(a Process in EventSensor(InputSensor)>>userInte...etc...
        eventQueue: a SharedQueue
        inputSemaphore: a Semaphore()
        lastEventPoll: 185422
        hasInputSemaphore: true


--- The full stack ---
EventSensor>>processEvent:
EventSensor>>fetchMoreEvents
EventSensor>>primKbdPeek
EventSensor(InputSensor)>>keyboardPressed
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventSensor(InputSensor)>>kbdTest
UndefinedObject>>DoIt
Compiler>>evaluate:in:to:notifying:ifFail:logged:
[] in TextMorphEditor(ParagraphEditor)>>evaluateSelection '--source missing--'
BlockContext>>on:do:
TextMorphEditor(ParagraphEditor)>>evaluateSelection
TextMorphEditor(ParagraphEditor)>>printIt
[] in TextMorphEditor(ParagraphEditor)>>printIt: {[self printIt]}
TextMorphEditor(Controller)>>terminateAndInitializeAround:
TextMorphEditor(ParagraphEditor)>>printIt:
TextMorphEditor(ParagraphEditor)>>dispatchOnCharacter:with:
TextMorphEditor>>dispatchOnCharacter:with:
TextMorphEditor(ParagraphEditor)>>readKeyboard
TextMorphEditor>>readKeyboard
[] in TextMorphForEditView(TextMorph)>>keyStroke: '--source missing--'
TextMorphForEditView(TextMorph)>>handleInteraction:fromEvent:
TextMorphForEditView>>handleInteraction:fromEvent:
TextMorphForEditView(TextMorph)>>keyStroke:
TextMorphForEditView>>keyStroke:
TextMorphForEditView(TextMorph)>>handleKeystroke:
KeyboardEvent>>sentTo:
TextMorphForEditView(Morph)>>handleEvent:
TextMorphForEditView(Morph)>>handleFocusEvent:
[] in HandMorph>>sendFocusEvent:to:clear: '--source missing--'
[] in PasteUpMorph>>becomeActiveDuring: '--source missing--'
BlockContext>>on:do:
PasteUpMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendKeyboardEvent:
HandMorph>>handleEvent:
HandMorph>>processEvents
[] in WorldState>>doOneCycleNowFor: '--source missing--'
Array(SequenceableCollection)>>do:
WorldState>>handsDo:
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
PasteUpMorph>>doOneCycle
[] in Project class>>spawnNewProcess {[[World doOneCycle. Processor yield. false] whileFalse. nil]}
[] in BlockContext>>newProcess '--source missing--'
 
(0013664 - 43 - 43 - 43 - 43 - 43 - 43)
laza
04-08-10 14:17

This is still true in a pre 4.1 trunk image
 

- Issue History
Date Modified Username Field Change
06-28-05 18:11 KenCausey New Issue
06-28-05 18:12 KenCausey Reporter KenCausey => dvf
06-28-05 18:14 KenCausey Note Added: 0001682
06-28-05 18:19 KenCausey Note Added: 0001683
04-08-10 14:16 laza Assigned To  => lewis
04-08-10 14:16 laza Status new => assigned
04-08-10 14:16 laza version 3.9 => trunk
04-08-10 14:17 laza Note Added: 0013664
04-08-10 14:17 laza Status assigned => confirmed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
51 total queries executed.
40 unique queries executed.
Powered by Mantis Bugtracker