View unanswered posts | View active topics It is currently Wed May 22, 2013 7:03 pm



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 29 posts ]  Go to page 1, 2  Next
 languageBar plugin or how to get keyboard layout code using 
Author Message
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post languageBar plugin or how to get keyboard layout code using
Hi everyone!
Sorry for mistakes. This is the last time I write this words - I just put the same in my signature :)
I thought over enough and have decided to post this topic here with thought in mind, that someone can agree to write such plugin.

I want to create languageBar using BBInterface and TCL. I hope, it is possible to get keyboard layout code using TCL. But my knowledge and expirience of programming on TCL limited with few keywords and few simple scripts.

Please, help me to create such script on TCL or just listen to my request of such plugin.

Thanks.

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Sat Jul 28, 2007 3:40 pm
Report this post
Profile ICQ
Sponsored Links
Google Adsense


Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
The problem is that the language layout is per application/window, and not truely a global setting. There is a default layout, but it can be changed for specific application instances. That means the Tcl script would need to be told when a new application has focus or one has lost focus and then get the language layout for the newly focused window, or the default language layout if there is no focused window. While not impossible, I think it's made a little harder by the fact that Tcl-bb does not support proper threading, didn't know how to make it work back then.

-- Brian

_________________
-- Brian


Sat Jul 28, 2007 5:10 pm
Report this post
Profile ICQ YIM WWW
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
You are right... I didn't think about this.
But it means, that I've choose proper forum for my theme :wink:

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Sat Jul 28, 2007 6:41 pm
Report this post
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
Here's my little 6 hours plugin ;) Had to relearn a bit of the api to make this work, but it does seem to work :D

So here's how it works (dumbed down to the basic 4 api calls):
Code:
HWND CurApp=GetForegroundWindow();
DWORD idthd=GetWindowThreadProcessId(CurApp,NULL);
HKL layid = GetKeyboardLayout(idthd);
...
GetLocaleInfo(MAKELCID(layid, 0), LOCALE_SABBREVLANGNAME, m_szLanguage, l);


This has up sides and downside. Upside, I made it bro@m-able:

@langdis prev goes to the previous keyboard layout
@langdis next goes to the next keyboard layout

This plugin requires that it be loaded in the slit or bbinterface (or some other plugin that uses beginPluginEx to load other plugins).

Downsides:
1. Has to be slitted (cause I was lazy)
2. Even though I could make it so that you could right click on the plugin to change keyboard layouts, my testing show that it would change the layout for the plugin, which does you absolutely no good..... Damn!

Ideas are welcome, but I think it works, alright anyway. I can't get the same two letter codes that are displayed by Microsoft's Language selector tool thing, so that's why you see 3 letters (or I do anyway..) That's really all I can think of.

The 2 screenshots below show what is displayed (for me) switching between 2 windows, one with English locale/language, one with Japanese. I know, a movie would be better, but I'm ready for bed ;) Plugin is top right


Attachments:
File comment: LangDis v1.4
LangDis.dll [10 KiB]
Downloaded 208 times
screen2.PNG
screen2.PNG [ 127.09 KiB | Viewed 4351 times ]
screen1.PNG
screen1.PNG [ 138.71 KiB | Viewed 4212 times ]

_________________
-- Brian
Mon Jul 30, 2007 5:55 am
Report this post
Profile ICQ YIM WWW
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
tresni, thank you for this plugin!

But... :( I get a message from bbLean "The plugin you are trying to load does not exist or cannot be loaded" every time I try to load plugin in BBInterface.

At last, I loaded bbslit in my bbLean and then tried to load LangDis. But I've got next error message :( :
Quote:
... Posiible reasons:
- The plugin is incompatible with the windows version.
- The plugin is incompatible with this blackbox version.

Changing my balckbox.exe to versions from the bbLeanMod (070622) and from the bbClean (don't know it' version or date) didn't help me. So I draw a conclusion, that I have incompatible version of windows (XP Pro SP1).

About plugin
Quote:
Downsides:
1. Has to be slitted (cause I was lazy)

I think this is upside, because you can tune how laguage bar looks :wink: .

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Mon Jul 30, 2007 9:39 am
Report this post
Profile ICQ
Moderator
User avatar

Joined: Sat Dec 11, 2004 12:06 am
Posts: 1310
Location: Violent Paradise
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
eDio wrote:
...So I draw a conclusion, that I have incompatible version of windows (XP Pro SP1).

Nah! nothing so drastic. That dialog can be very misleading. If you were running Win9x\ME, it might be true. But, if you are running Win2k and above what it generally means is that you don't have a required set of runtime DLLs installed on your system.

In this case, I happen to know that tresni is using the latest MS Visual Studio to do development. So, what it means is that you do not have the .Net 2.0 framework installed on your system. You'll either need that OR, if you don't want to install that huge library, just install the MSVC 8 runtimes, which is all you really need.

_________________
I'll have the roast duck... with mango sauce and a large helping of BB4Win Wiki: http://wiki.bb4win.org/wiki/Main_Page


Mon Jul 30, 2007 1:10 pm
Report this post
Profile
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
Quote:
you do not have the .Net 2.0 framework installed on your system

.net 2.0 already installed on my system. I even have installed vcredist_x86. But every time I triyng to load this plugin in BBI, I get a message, that plugin does not exist or cannot be loaded :( .

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Mon Jul 30, 2007 3:01 pm
Report this post
Profile ICQ
Moderator
User avatar

Joined: Sat Dec 11, 2004 12:06 am
Posts: 1310
Location: Violent Paradise
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
Well, you don't need a different OS, you are just missing some runtime or other. Maybe tresni used another version of VS for this ??? You could try the MSVC 7 runtimes, theres a boatload of other plugins that require them anyway.

_________________
I'll have the roast duck... with mango sauce and a large helping of BB4Win Wiki: http://wiki.bb4win.org/wiki/Main_Page


Mon Jul 30, 2007 4:51 pm
Report this post
Profile
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
Quote:
MSVC 7 runtimes

These dlls were in my system32\ early.

I have tried also dlls from VC8 redist (mfc80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll).
Later I'll reboot and try once more.
I'll write about results.
_____________
added on 20:43
I still cannot load langdis in BBI :(

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Mon Jul 30, 2007 5:38 pm
Report this post
Profile ICQ
BBDinosaur

Joined: Tue Feb 27, 2007 9:12 am
Posts: 311
Location: Behind The Couch
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
try putting them (msvc7-8 runtimes) in your blackbox directory


Mon Jul 30, 2007 8:58 pm
Report this post
Profile
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
MSVC 8 runtimes required.

Just make sure you are loading the plugin in the slit (via & in the plugins.rc). I'll probably "fix" that later, but yeah ;)

I didn't actually try it with BBInterface, just figured it would work ;) I'll dig through the BBI source and see how it's loading plugins and if that error means something specific.

The only thing I have tested the plugin with is xoblite (as the screenshot shows ;) )

_________________
-- Brian


Mon Jul 30, 2007 9:10 pm
Report this post
Profile ICQ YIM WWW
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
I have installed MICROSOFT VISUAL C++ 2005 RUNTIME LIBRARIES (previously an old version was installed on my machine maybe, fresh file from MS site has different size). But I get a new problem - my blackbox.exe crushes every time I try to load plugin. Situation is the same for slit and BBI. I want to use this plugin but I don't want to change my bblean to xoblite :wink:

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Mon Jul 30, 2007 9:54 pm
Report this post
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
What's your setup? BBLean version? Plugin versions? etc.. I'll see if I can duplicate this at home.

_________________
-- Brian


Mon Jul 30, 2007 11:07 pm
Report this post
Profile ICQ YIM WWW
BBSage
User avatar

Joined: Thu Jul 26, 2007 12:27 pm
Posts: 116
Location: Kyiv, Ukraine
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
bbLean - 1.16 (original build by Grischka) and all plugins originally included, except bbLeanbar.
------
bbLeanBar - an old Alex3D mod with minor tweaks. You know.
------ "slits"
BBSlit - 0.01.07 :wink: by Tres`ni
BBInterface - 0.9.9
------ others
bbColorEx - 0.0.2
bbTaskSwitch - 0.1.1
bbRun - 0.0.6
bbMemLimiter - have no any info about version. Just "Written by nocd5. Slight modification by Tres`ni"
tcl-bb - 1.2.0
bbSky - 0.0.1

_________________
Read this first: sorry for my mistakes above ;) . I'm Ukrainian and don't know English well.


Mon Jul 30, 2007 11:33 pm
Report this post
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post Re: languageBar plugin or how to get keyboard layout code using
Definately an issue with bbLean, honestly I don't know what it is though.. The error is happening after the plugin initializes so I don't know where the error is happening, it's happening outside of the plugin's code...

So, given that I don't know how to debug anything that I didn't write (and that doesn't compile/load in MSVC), looks like this may be xoblite only unless some adventuring BBLean person who knows how to debug wants to help me out.

_________________
-- Brian


Tue Jul 31, 2007 12:57 am
Report this post
Profile ICQ YIM WWW
Sponsored Links
Google Adsense


Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 29 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.