Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to handle language switch? (Ctrl+Shift or Alt+Shift)  (Read 4625 times)

0 Members and 1 Guest are viewing this topic.

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« on: March 07, 2012, 11:34:42 am »
Want to improve my text box so a user can decide in what language to type. So far seems like sfml doesn't handle language switch by default - nothing happens and i'm always with my system default language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #1 on: March 07, 2012, 12:04:32 pm »
There's nothing to do to make language switches work, it's all handled by the OS.

I've made some tests, and I found that changing the language works in SFML, but only after you "do" something with the window: move it, resize it, click the icon. And you have to do this everytime you change the language, otherwise it won't be applied.

This is really strange and I have no idea why it behaves like this. It definitely needs further investigation. I'll add an issue to the tracker.

By the way, we're only talking about Windows, right? I haven't tested other OSes and don't even knwo how language switch works on them.
Laurent Gomila - SFML developer

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #2 on: March 07, 2012, 02:16:31 pm »
I'm quite sure your active window should receive a window message notifying you about the change - which I guess is dropped or unhandled right now. More to read about it here.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #3 on: March 07, 2012, 02:23:43 pm »
Quote
I'm quite sure your active window should receive a window message notifying you about the change - which I guess is dropped or unhandled right now. More to read about it here.

It does receive the messages (WM_INPUTLANGCHANGEREQUEST and WM_INPUTLANGCHANGE), and they don't need to be handled explicitely (and I'm not dropping them explicitely). But for some obscure reason they don't reach the SFML's event loop until something happens on the window (resize, move, ...). ... like I said right above ;)
Laurent Gomila - SFML developer

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #4 on: March 07, 2012, 03:12:58 pm »
I'm talking only about Windows.

Heh, and I'm running fullscreen  :) . So hard to do something with the window.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #5 on: March 13, 2012, 08:51:53 am »
I found two interesting things.

1. It seems to work fine on Windows 7

2. I found this thread and the given workaround (a modification inside SFML) solves the problem
Laurent Gomila - SFML developer

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #6 on: March 13, 2012, 02:54:48 pm »
1) I was actually testing it on Windows 7 and it didn't work. That's how a found that issue

2) You mean now the latest SFML contains this fix ? Or I should do it myself if i need to

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to handle language switch? (Ctrl+Shift or Alt+Shift)
« Reply #7 on: March 13, 2012, 05:00:22 pm »
Quote
I was actually testing it on Windows 7 and it didn't work. That's how a found that issue

Uh :?
Note that for me, Ctrl+Alt doesn't work, but it's a different problem, not related to SFML. I found several reports on internet for the same bug. I had to assign a shortcut to a specific language (like Ctrl+0 to switch to english), and this one works fine.

Quote
You mean now the latest SFML contains this fix ?

No, because I still don't understand why this modification makes it work. I'm not supposed to do this modification (and I don't want to).
Laurent Gomila - SFML developer

 

anything