PureBasic Forum
http://forums.purebasic.com/english/

KeyboardInkey() doesn't return unicode
http://forums.purebasic.com/english/viewtopic.php?f=4&t=76298
Page 1 of 1

Author:  LinXP [ Wed Nov 18, 2020 11:30 pm ]
Post subject:  KeyboardInkey() doesn't return unicode

Hi all

Example:
Code:
If InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Header Error", "Can't open DirectX 7 or later", 0)
  End
EndIf
If OpenWindow(0,0,0,300,200, "bug test",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
 
  If OpenWindowedScreen(WindowID(0),0, 0, 300,200,0,0,0 )
    noquit=1
    While noquit
      we.l=WaitWindowEvent()
      ExamineKeyboard()
      If KeyboardPushed(#PB_Key_Escape)
        noquit=0
      EndIf
      key.s=KeyboardInkey()
      If key<>""
        Debug "Key: " + key +" ("+Asc(key)+")"
      EndIf
      Delay(1)
    Wend
  EndIf
EndIf
End


It is easy to check by adding, for example, a Russian layout and open the "on-screen keyboard"
Image Image
the work of the KeyboardInkey () function also affects the work of other 3d gadgets, where input in other languages is required

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/