my new robot BASIC COMPILER keyboard problem ...

Just starting out? Need help? Post your questions and find answers here.
marc_256
Enthusiast
Enthusiast
Posts: 744
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

my new robot BASIC COMPILER keyboard problem ...

Post by marc_256 »

Hello,

For my new walking robot, I'm creating a personalized ARDUINO DUE - BASIC COMPILER/DEBUGGER GUI/IDE.
Starting with a text editor.
I use OpenScreen (...) graphic mode for this, so graphically everything is OK, except if I use the keyboard.
The keys ['], ["] and [^] are giving me wrong results ... all others are OK ?
I'm using COURIER NEW 8...12 pnt font for the IDE.
(See the debug file below.)

I use the following program (part of a big one)

Code: Select all

	KeyboardMode (#PB_Keyboard_Qwerty | #PB_Keyboard_International)
	...

	ExamineKeyboard ()

	Keyboard_Key = KeyboardInkey ()
	Keyboard_Key_Value = Asc (Keyboard_Key)

	If Asc (Keyboard_Key) > 0
		Debug "KEY PUSHED : " + Asc (Keyboard_Key) + " <-> CHARACTER : " + Keyboard_Key
	EndIf
How can I change this errors ?
I use PB 5.73 x64 on Win 10 home.

Thanks,
Marc

Image


Image
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Demivec
Addict
Addict
Posts: 4089
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: my new robot BASIC COMPILER keyboard problem ...

Post by Demivec »

marc_256 wrote: Thu Apr 29, 2021 10:19 am

Code: Select all

	KeyboardMode (#PB_Keyboard_Qwerty | #PB_Keyboard_International)
The flags you used for KeyboardMode() should not be combined, they are opposites with the values of 0 and 1. That means using #PB_Keyboard_International will always override #PB_Keyboard_Qwerty:

Code: Select all

#PB_Keyboard_Qwerty         : The keyboard ignores the default language layout and always uses
                              the QWERTY one (default behavior).
#PB_Keyboard_International  : The keyboard uses the default language layout to map the keys (can be 
                              useful for non QWERTY keyboards).
infratec
Always Here
Always Here
Posts: 6866
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: my new robot BASIC COMPILER keyboard problem ...

Post by infratec »

I don't get this keys, I only get the key for the '2' for example, but never for the '"' which is the shifted character of '2'.
How did you get this separated?
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: my new robot BASIC COMPILER keyboard problem ...

Post by Fig »

It may help you https://www.purebasic.fr/french/viewtop ... er#p194979
You can use a keyboardhook cf Zorro post.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
marc_256
Enthusiast
Enthusiast
Posts: 744
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: my new robot BASIC COMPILER keyboard problem ...

Post by marc_256 »

Hallo,

@ Demivec,
i changed it, thanks, i gone test it in a few minutes.

@ infratec,
on my computers I have a fixed AZERTY keyboard, but I dont like this.
So, when I'm programming I use a external extended QWERTY keyboards :D
Image

@Fig,
I like to compile this program in windows, linux and OS
so i need to stay on only PB syntax.

thanks
marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply