KeyboardInkey() in Ubuntu 10.10 PB4.51?

Linux specific forum
User avatar
Kapslok
User
User
Posts: 34
Joined: Tue Sep 01, 2009 2:29 pm
Location: Finland

KeyboardInkey() in Ubuntu 10.10 PB4.51?

Post by Kapslok »

Hi!

The following example from PB Linux Quickhelp for KeyboardInkey() doesn't work here as expected. The keyboardPushed is checked ok (I can exit the program), but KeyboardInkey() gives an empty string. Can anyone confirm this behaviour or is there a reason for this?

Greetings,
Kapslok

Code: Select all

If InitSprite() And InitKeyboard() And OpenScreen(800,600,16,"")
    Repeat
      FlipBuffers()
      ClearScreen(RGB(0, 0, 0))

      ExamineKeyboard()
      FullText$ + KeyboardInkey()  ; Add the new text to the current one (if any)

      ; If we press the 'Back' key, we will delete the last character
      ;
      If KeyboardReleased(#PB_Key_Back)
        FullText$ = Left(FullText$, Len(FullText$)-1)
      EndIf

      ; Display the result
      ;
      If StartDrawing(ScreenOutput())
        DrawingMode(1)
        FrontColor(RGB(128, 255, 0))
        DrawText(20, 20, "Just type some text...:")
        DrawText(20, 40, FullText$)
        StopDrawing()
      EndIf
    Until KeyboardPushed(#PB_Key_Escape)
  EndIf

User avatar
Kapslok
User
User
Posts: 34
Joined: Tue Sep 01, 2009 2:29 pm
Location: Finland

Re: KeyboardInkey() in Ubuntu 10.10 PB4.51?

Post by Kapslok »

Code: Select all

KeyboardMode(#PB_Keyboard_International)
This command was missing from the example.

Greets,
K
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

Re: KeyboardInkey() in Ubuntu 10.10 PB4.51?

Post by GBeebe »

Yup, common problem. I think InitKeyboard() should set KeyboardMode(#PB_Keyboard_International) by default.
Post Reply