Help with non-english keyboards

  • Thread starter Thread starter Tusike
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the challenges of detecting key presses on non-English keyboards, specifically Hungarian keyboards, while programming in C++ or FreeBasic. Participants explore issues related to keyboard input, locale settings, and scan codes.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • Tusike expresses frustration over not being able to detect certain Hungarian characters in their program, despite some keys working with scan codes.
  • One participant suggests checking the system locale settings, providing a link to information about how changing the locale affects character sets and input.
  • Tusike questions whether changing the locale would also change the scan codes returned by the keyboard.
  • Another participant speculates about the need to create different interpretations of keyboard input for different locales, indicating a potential solution.
  • Participants acknowledge their varying levels of experience with C++ and FreeBasic, which may limit the assistance they can provide.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to solve the key detection issue, and multiple competing views regarding the role of locale settings and scan codes remain. The discussion is unresolved.

Contextual Notes

There are limitations regarding the assumptions about how locale changes affect keyboard input and the specific implementation details in programming languages like C++ and FreeBasic.

Tusike
Messages
137
Reaction score
0
Hi! I have a program I want to share with my friends, but they have hungarian computers, and I'm unable to detect some of the key presses. Can anyone provide a sample C++ or FreeBasic program that does the following:

1)Waits for me to press a key I see on my keyboard
2)Prints that key on my screen.
3)Returns to part 1), and does so until ESC is pressed.

That is all I'm asking. Even just showing me how to start would be great, although I'm not real good in C++. It's been driving me mad for a few hours now. I'm just unable to detect letters such as Á, Í, Ó, Ű, etc... Actually some of them do work using scan codes, but using what I have, the key for Í doesn't return any scan code. And some of the scan codes are different (e.g. for Ö it's 11 on my english keyboard, using alt-shift to change it to hungarian; and on a real hungarian keyboard it's 41). All I want is to see the key I pressed on my keyboard appear on the screen. Why is this so difficult? Even this forum can do it!

Sorry for the tone it's just that this is supposed to be fairly simple, and I've been trying for hours now.

Thanks for any help,
-Tusike
 
Technology news on Phys.org
Hi there. Now I'm not a C++ programmer or a FreeBasic programmer but I hope I can give you some insight on how to do this (if I understood it correctly, that is). Have you ever tried to http://windows.microsoft.com/en-US/windows-vista/Change-the-system-locale" The link I posted here gives you some information on what changing the locale does.

"The system locale determines the default character set (letters, symbols, and numbers) and font that you use to enter information and that are used to display information in programs that do not use Unicode."*

Hope I helped you a little.

*From the link that I gave to you
 
Last edited by a moderator:
I'm not sure that's what I'm looking for, I'll check it out tomorrow though. See my friends probably won't go through a lot of trouble to make sure my program works for them, they don't care that much:) When a key is pressed, the keyboard is supposed to return some sort of value that describes which key has been pressed; what I'm looking for is how Mozilla, Microsoft Word, and pretty much every program that is a bit advanced interpret the keyboard. E.g. in M$ Word, no one ever has a problem with the keyboard.
 
Okay, sorry for the misunderstanding. But if you change your locale, don't you think that the scan codes will also change as well? I'm new to this kind of thing, but I was only trying to help out :D.

EDIT: When I say change your locale, I mean through your program, not necessarily through the control panel etc.
 
You are probably right about that, and I'll test it out tomorrow when it's not 10 PM; but you see I don't want to have the readme file to the program say "Note: in order for this to work correctly, every time you wish to use this program change your locale to English (United States) & restart your computer".

Of course what may work is for me to create two sets of ways the keyboard is interpreted; one for that and one for a hungarian locale. I must see if this works, thanks for the suggestion!
 
Well I hope that your program works! I'm not experienced in this field so don't expect me to be too much help XD.
 

Similar threads

  • · Replies 24 ·
Replies
24
Views
2K
Replies
12
Views
3K
Replies
11
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K
Replies
17
Views
2K
Replies
3
Views
4K
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K