Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #7348

Re: Input Keyboard language

From "Jamal" <someone@example.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Input Keyboard language
Date 2014-10-22 15:36 -0400
Organization Aioe.org NNTP Server
Message-ID <m290vu$pmn$1@speranza.aioe.org> (permalink)
References <a2ce31e7-9fb7-47c9-b64d-dad266d16aa9@googlegroups.com> <m26pnt$5ur$1@speranza.aioe.org>

Show all headers | View raw


On further research, here is the win32 API way using VO code:

DEFINE LOCALE_SLOCALIZEDLANGUAGENAME := 0x0000006f

FUNCTION GetActiveKeyboardLayout() as STRING PASCAL
local pKeyboardID as ptr
local LCID as word
local cLayout as string

             pKeyboardID := GetKeyboardLayout(0)

             If pKeyboardID != null_ptr
                  LCID := LoWord(dword(_cast, pKeyboardID))
                  IF LCID > 0
                    cLayout := GetUserLocaleInfo(LCID, 
LOCALE_SLOCALIZEDLANGUAGENAME)
                    // cLayout := GetUserLocaleInfo(LCID, 
LOCALE_SENGLANGUAGE )  // LOCALE_SENGLANGUAGE is depricated in Windows 7 and 
later; however, it still works in Windows 8.1 !!

                  EndIF
             ENDIF
RETURN cLayout

FUNCTION GetUserLocaleInfo(dwLocaleID as dword, dwLCType as Long) AS STRING 
PASCAL
LOCAL pBuffer as psz
LOCAL nBuffSize as DWORD
LOCAL nResult as DWORD
LOCAL cReturn as STRING

nBuffSize := 128
pBuffer := StringAlloc(Replicate(" ", nBuffSize))

nResult := GetLocaleInfo(dwLocaleID, dwLCType, pBuffer, nBuffSize)

IF nResult > 0
      cReturn := Left(Psz2String(pBuffer), nResult)
ENDIF

MemFree(pBuffer)

RETURN cReturn


Jamal Assaf

"Jamal"  wrote in message news:m26pnt$5ur$1@speranza.aioe.org...

George,

I tried to find anything in VO that provides such a functionality and found
nothing.

In .NET it is pretty easy.  To use in VO you need to create a COM visible
class either in VB.NET or C# and add into VO as an Automation Server.

To make the class COM visible in Visual Studio 2013, go to app properties,
Application tab, Assembly Info and tick the Make Assembly COM visible.

I created a sample for you below which I tested and works fine.


VB.NET Code:

Imports System.Runtime.InteropServices
Imports System.Windows.Forms

Namespace KeybaordSpace

<ClassInterface(ClassInterfaceType.AutoDual)>

Public Class KeyboardLanguage
         Public Input_Language As String


        Public Sub New()
            Input_Language =
System.Windows.Forms.InputLanguage.CurrentInputLanguage.LayoutName()
        End Sub
  End Class
End Namespace


VO Code:

local o as _KeyboardLanguage   // note ther underscore

         o := _KeyboardLanguage{}

          ? "Input Language: " +  o:input_language


HTH,
Jamal

"George Tritsos"  wrote in message
news:a2ce31e7-9fb7-47c9-b64d-dad266d16aa9@googlegroups.com...

Hi all,

  I'm looking for a way to check the import language keyboard.

e.g

Καλημέρα!!!  Greece Keyboard
Alt+Swift
Kalimera!!!  English Keyboard

Thanks in advance
George 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Input Keyboard language George Tritsos <GeorgeTritsos@yahoo.gr> - 2014-10-21 09:43 -0700
  Re: Input Keyboard language D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2014-10-21 19:32 +0200
  Re: Input Keyboard language "Jamal" <someone@example.com> - 2014-10-21 19:20 -0400
    Re: Input Keyboard language "Jamal" <someone@example.com> - 2014-10-22 15:36 -0400
      Re: Input Keyboard language George Tritsos <GeorgeTritsos@yahoo.gr> - 2014-10-22 13:07 -0700
  Re: Input Keyboard language "Fred Killet" <info@killetsoft.de> - 2014-10-22 18:41 +0200

csiph-web