5

i need to to force alt + shift in Delphi to make my language of the app. I tried with keybd_event calling it twice, but it didn't do the trick.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
dzibul
  • 612
  • 2
  • 7
  • 20
  • 1
    You don't, for two reasons: the user might have disabled this keyboard shortcut, and messing around the user settings without her/his consent is a no-no. – Jeroen Wiert Pluimers Jan 06 '11 at 09:49

2 Answers2

9

Do you want to switch input language of your application? Use ActivateKeyboardLayout function for this.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
2

Do you control the system to be sure that it's going to respond to that? I have an alternate language installed but it can only be switched via the mouse, I have disabled the keyboard shortcuts. The problem is that I rarely actually need the alternate but I was frequently switching by accident.

Loren Pechtel
  • 8,945
  • 3
  • 33
  • 45
  • +1 for pointing out that messing with a user's preferences is rarely a good idea and might end up with doing lots of unexpected things. – dummzeuch Jan 06 '11 at 09:19