Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #7342 > unrolled thread
| Started by | George Tritsos <GeorgeTritsos@yahoo.gr> |
|---|---|
| First post | 2014-10-21 09:43 -0700 |
| Last post | 2014-10-22 18:41 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
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
| From | George Tritsos <GeorgeTritsos@yahoo.gr> |
|---|---|
| Date | 2014-10-21 09:43 -0700 |
| Subject | Input Keyboard language |
| Message-ID | <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
[toc] | [next] | [standalone]
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2014-10-21 19:32 +0200 |
| Message-ID | <706d4ahjqatnknob2s2pe738bctbhv8on7@4ax.com> |
| In reply to | #7342 |
On Tue, 21 Oct 2014 09:43:00 -0700 (PDT), George Tritsos <GeorgeTritsos@yahoo.gr> wrote: Hello John, > > I'm looking for a way to check the import language keyboard. > No idea if you can do it in VO, sorry, but for these kind of things I nowadays search the internet, e.g.: http://stackoverflow.com/questions/12951067/how-to-determine-the-current-input-language then translate the C# code to Vulcan code using Reflector and add it in my Vulcan library, after which I can call it straight from VO. Recent additions have been a check for the validity of an e-mail address and save a image in the clipboard as JPG file. Dick
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <someone@example.com> |
|---|---|
| Date | 2014-10-21 19:20 -0400 |
| Message-ID | <m26pnt$5ur$1@speranza.aioe.org> |
| In reply to | #7342 |
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
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <someone@example.com> |
|---|---|
| Date | 2014-10-22 15:36 -0400 |
| Message-ID | <m290vu$pmn$1@speranza.aioe.org> |
| In reply to | #7344 |
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
[toc] | [prev] | [next] | [standalone]
| From | George Tritsos <GeorgeTritsos@yahoo.gr> |
|---|---|
| Date | 2014-10-22 13:07 -0700 |
| Message-ID | <897daabe-2ce1-4fc2-ab69-0aed2fd7c90e@googlegroups.com> |
| In reply to | #7348 |
Thanks all for reply and especially Jamal. The code works perfect for me. Thanks a lot again. Best Regards George
[toc] | [prev] | [next] | [standalone]
| From | "Fred Killet" <info@killetsoft.de> |
|---|---|
| Date | 2014-10-22 18:41 +0200 |
| Message-ID | <m28mon$6un$1@news.albasani.net> |
| In reply to | #7342 |
Hi, there is a WIN API function named GetKeyboardLayout( ). It should be no problem to get the actual keyboard settings with this function as base. Fred -- Fred Killet killet-nospam@killetsoft.de --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web