Hikari (v0.3)
-
- Gnoblar
- Posts: 11
- Joined: Wed Jun 18, 2008 6:12 am
-
- Gnoblar
- Posts: 11
- Joined: Wed Jun 18, 2008 6:12 am
Very glad that I have basically solved the problem of the importation of ime, but the question now is to enter the cursor can not be displayed.
Below is my resolve ime input methods:
1,
2, create your own window, and then
This is a major part of the code, so that ime input method can not be normal role, it may be because SetWindowsHookEx unable to receive comprehensive information on windows, hope that they can improve on ajs15822 great Hikari to help.
My English well, it is with Google's automatic translation, please understanding:)
Below is my resolve ime input methods:
1,
Code: Select all
void KeyboardHook:: handleHook (UINT msg, HWND hwnd, WPARAM wParam, LPARAM lParam)
(
/ / Switch (msg)
/ / (
/ / Case WM_KEYDOWN:
/ / Case WM_KEYUP:
/ / Case WM_CHAR:
/ / Case WM_DEADCHAR:
/ / Case WM_SYSKEYDOWN:
/ / Case WM_SYSKEYUP:
/ / Case WM_SYSDEADCHAR:
/ / Case WM_SYSCHAR:
/ / Case WM_IME_CHAR:
/ / OutputDebugString ( "WM_IME_CHAR \ n");
/ / Case WM_IME_COMPOSITION:
/ / OutputDebugString ( "WM_IME_COMPOSITION \ n");
/ / Case WM_IME_COMPOSITIONFULL:
/ / OutputDebugString ( "WM_IME_COMPOSITIONFULL \ n");
/ / Case WM_IME_CONTROL:
/ / OutputDebugString ( "WM_IME_CONTROL \ n");
/ / Case WM_IME_ENDCOMPOSITION:
/ / OutputDebugString ( "WM_IME_ENDCOMPOSITION \ n");
/ / Case WM_IME_KEYDOWN:
/ / OutputDebugString ( "WM_IME_KEYDOWN \ n");
/ / Case WM_IME_KEYUP:
/ / OutputDebugString ( "WM_IME_KEYUP \ n");
/ / Case WM_IME_NOTIFY:
/ / OutputDebugString ( "WM_IME_NOTIFY \ n");
/ / Case WM_IME_REQUEST:
/ / OutputDebugString ( "WM_IME_REQUEST \ n");
/ / Case WM_IME_SELECT:
/ / OutputDebugString ( "WM_IME_SELECT \ n");
/ / Case WM_IME_SETCONTEXT:
/ / OutputDebugString ( "WM_IME_SETCONTEXT \ n");
/ / Case WM_IME_STARTCOMPOSITION:
/ / OutputDebugString ( "WM_IME_STARTCOMPOSITION \ n");
/ / Case WM_HELP:
/ / Case WM_CANCELMODE:
/ / (
/ / HikariManager * manager = Hikari:: HikariManager:: GetPointer ();
/ / If (manager)
/ / Manager-> handleKeyEvent (msg, wParam, lParam);
/ / Break;
/ /)
/ /)
)
Code: Select all
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
(
Switch (message)
(
Case WM_KEYDOWN:
Case WM_KEYUP:
Case WM_CHAR:
Case WM_DEADCHAR:
Case WM_SYSKEYDOWN:
Case WM_SYSKEYUP:
Case WM_SYSDEADCHAR:
Case WM_SYSCHAR:
Case WM_IME_CHAR:
Case WM_IME_COMPOSITION:
Case WM_IME_COMPOSITIONFULL:
Case WM_IME_CONTROL:
Case WM_IME_ENDCOMPOSITION:
Case WM_IME_KEYDOWN:
Case WM_IME_KEYUP:
Case WM_IME_NOTIFY:
Case WM_IME_REQUEST:
Case WM_IME_SELECT:
Case WM_IME_SETCONTEXT:
Case WM_IME_STARTCOMPOSITION:
Case WM_HELP:
Case WM_CANCELMODE:
(
If (hikariMgr)
hikariMgr-> handleKeyEvent (message, wParam, lParam);
Break;
)
)
return DefWindowProc (hWnd, message, wParam, lParam);
Return 0;
)
My English well, it is with Google's automatic translation, please understanding:)
-
- Goblin
- Posts: 267
- Joined: Tue Feb 28, 2006 12:30 pm
Great Library =). Very easy to use. But i have one question. I have a plane that i want to display a movie on:
But i can't seem to stretch the Movie out to cover the entire plane. Chaning the size of the FlashMaterial doesn't seem to get the desired effect. There is a Gray border around the plane and i think that this is part of the material you create.
But still Awesome library. Im going to try to implement a way to inject inputs into hikari through mouse picking and the texture system.
Code: Select all
mHikariMgr = new HikariManager("../Common/Media/Julius/Flash");
Movie = mHikariMgr->createFlashMaterial("Movie",600,600);
Movie->load("Test.swf");
Plane MoviePlane;
MoviePlane.normal = Vector3::UNIT_Z;
MoviePlane.d = 0;
Ogre::MeshManager::getSingleton().createPlane("MoviePlane",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
MoviePlane,
1,1,1,1,true,1,1,1,Vector3::UNIT_Y);
Entity* pPlaneEnt = mSceneMgr->createEntity( "MoviePlane1", "MoviePlane" );
MovieNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
MovieNode->attachObject(pPlaneEnt);
MovieNode->setPosition(Vector3(0,2,-5));
MovieNode->scale(2,2,2);
pPlaneEnt->setMaterialName( Movie->getMaterialName() );
But still Awesome library. Im going to try to implement a way to inject inputs into hikari through mouse picking and the texture system.
- ajs15822
- OGRE Expert User
- Posts: 570
- Joined: Mon Jan 02, 2006 2:05 am
- Location: Texas
- x 2
- Contact:
Thanks for lending some help. I tried your solution (embedding ogre within an external window and passing keyboard IME messages directly instead of using a hook) but still am having problems (I'm testing it with Japanese).jianfei5 wrote:Very glad that I have basically solved the problem of the importation of ime, but the question now is to enter the cursor can not be displayed.
Below is my resolve ime input methods:
...
Normally, when using IME in Flash, I type directly into the textbox and conversion is done automatically based on the current mode I'm in. Also, if I hit the spacebar at the end of a sentence, I get a little drop-down window that lets me select a kanji-equivalent.
In Hikari, however, Flash is embedded in a windowless site (it has no screen position or window handle) so when I start typing using IME, a little popup window appears in the top-left corner of the screen where I can see my hiragana/katakana/direct-input appearing as I type. When I hit enter, the text I entered appears in the Flash textbox however I get "????" for any hiragana/katakana/kanji characters (even if I'm in a font like MS Mincho).
This behavior is the same whether or not I pass IME messages via a message hook or directly from a real WindowProc.
I couldn't reproduce your success, could you please share your actual application code?
Ah, your videocard probably has limited support for textures with sizes that are non-powers-of-two. What you're seeing is Hikari automatically compensating for this by bumping up the texture size to the next-highest power-of-two size (the gray stuff is padding).jchmack wrote:But i can't seem to stretch the Movie out to cover the entire plane. Chaning the size of the FlashMaterial doesn't seem to get the desired effect. There is a Gray border around the plane and i think that this is part of the material you create.
When a FlashControl is created as an overlay and this behavior occurs, the overlay's UV coordinates are automatically scaled to match any internal texture-size compensation.
Since you're creating it as a pure material, you will need to adjust the UV coordinates of your mesh yourself-- however, to do that would require knowing how much to scale the coords, and I haven't exposed that bit of API just yet. Look for it in the next SVN revision.
-
- Gnoblar
- Posts: 11
- Joined: Wed Jun 18, 2008 6:12 am
I spent some time compiled my code, and it HikariDemo a combination, can be successfully passed the compiler and to normal operation, the following are the relevant picture.
Can be downloaded through a link below to complete the code.
http://www.file-upload.net/member/downl ... t.rar.html
In addition, I also found that if the window was not exaggerating when activated, can see the flash Exitbox enter cursor.
To the relevant picture, this should be some intuitive.
Can be downloaded through a link below to complete the code.
http://www.file-upload.net/member/downl ... t.rar.html
In addition, I also found that if the window was not exaggerating when activated, can see the flash Exitbox enter cursor.
To the relevant picture, this should be some intuitive.
Last edited by jianfei5 on Fri Jun 20, 2008 2:14 pm, edited 1 time in total.
-
- Goblin
- Posts: 267
- Joined: Tue Feb 28, 2006 12:30 pm
ah i believe you are correct:ajs15822 wrote: Ah, your videocard probably has limited support for textures with sizes that are non-powers-of-two. What you're seeing is Hikari automatically compensating for this by bumping up the texture size to the next-highest power-of-two size (the gray stuff is padding).
When a FlashControl is created as an overlay and this behavior occurs, the overlay's UV coordinates are automatically scaled to match any internal texture-size compensation.
Since you're creating it as a pure material, you will need to adjust the UV coordinates of your mesh yourself-- however, to do that would require knowing how much to scale the coords, and I haven't exposed that bit of API just yet. Look for it in the next SVN revision.
14:54:30: * Non-power-of-two textures: yes (limited)
And if i change the dimensions of the overlay:
Movie = mHikariMgr->createFlashOverlay("Movie", mViewport, 512, 512, Position(TopLeft), 0);
it runs like i want (and faster i believe).
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
that's cool, it's be great if you could upload that to the MOgre wiki. My students would benefit alot since they use some flash aswell as MOgreGantZ wrote:Good work,
I have start to use the library along with MOGRE in csharp after writing a simple wrapper and i've got result really fast !
it seems to be a pretty decent GUI solution for .net
thanks for sharing !
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
that's cool, it's be great if you could upload that to the MOgre wiki. My students would benefit alot since they use some flash aswell as MOgre and I've been too scared to get them to use CEGuiGantZ wrote:Good work,
I have start to use the library along with MOGRE in csharp after writing a simple wrapper and i've got result really fast !
it seems to be a pretty decent GUI solution for .net
thanks for sharing !
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
- Brocan
- Orc
- Posts: 441
- Joined: Tue Aug 01, 2006 1:43 am
- Location: Spain!!
- x 8
- GantZ
- Kobold
- Posts: 33
- Joined: Thu Jan 31, 2008 9:23 pm
- Location: France
well, i just wrapped the basic stuff for the moment since i start use the library two day ago and i'm afraid the code is quite dirtyVectrex wrote: that's cool, it's be great if you could upload that to the MOgre wiki. My students would benefit alot since they use some flash aswell as MOgre and I've been too scared to get them to use CEGui
I will try to port the demo and upload it next week
- ajs15822
- OGRE Expert User
- Posts: 570
- Joined: Mon Jan 02, 2006 2:05 am
- Location: Texas
- x 2
- Contact:
Thanks alot!jianfei5 wrote:I spent some time compiled my code, and it HikariDemo a combination, can be successfully passed the compiler and to normal operation, the following are the relevant picture.
Can be downloaded through a link below to complete the code.
http://www.file-upload.net/member/downl ... t.rar.html
In addition, I also found that if the window was not exaggerating when activated, can see the flash Exitbox enter cursor.
To the relevant picture, this should be some intuitive.
I still couldn't get it working correctly with my Japanese IME, but I'm much less experienced with IME and am probably doing something else wrong-- I'm just happy that you've got it working on your end.
Until we find a better solution, I'll modify HikariManager to allow users to disable the keyboard hook and directly inject keyboard/IME events from their window proc.
As for the text caret, that's really weird that it is only rendering when the main window is not activated/focused. I don't understand how that can even happen because the Flash ActiveX control is embedded entirely within a windowless OLE control, it has no real connection to the state of the containing window (which is why we must inject all mouse/keyboard events).
What would "setEnable" do? Give it keyboard focus? If so, you can already do that using FlashControl::focus().Some of the recommendations
1, class FlashControl increase setEnable function
2, class FlashControl increase setAlwaysOnTop function
"setAlwaysOnTop" is a good suggestion, I will think about it.
Sure, here is the ActionScript3 code from controls.fla:ajs15822, can you provide the .as of the control and fps counter shown into the demo?
Code: Select all
import fl.controls.Button;
import fl.controls.Slider;
import fl.events.SliderEvent;
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent
opacitySlider.addEventListener(SliderEvent.CHANGE, function(event:SliderEvent){
opacity_txt.text = event.value + "%";
ExternalInterface.call("opacityChange", event.value);
});
colorPicker.addEventListener(ColorPickerEvent.CHANGE, function(event:ColorPickerEvent){
ExternalInterface.call("colorChange", event.color);
});
exit_btn.addEventListener(MouseEvent.CLICK, function(){
ExternalInterface.call("exitClick");
});
Code: Select all
function setFPS(fps:Number)
{
fps_txt.text = fps.toString();
}
ExternalInterface.addCallback("setFPS", setFPS);
-
- Gnoblar
- Posts: 11
- Joined: Wed Jun 18, 2008 6:12 am
setEnable the usefulness lies in the fact that we may use the background image, if we use a FlashControl as a background image, when the mouse click on it, we do not have to put it on top of the screen, so obscured by other windows.What would "setEnable" do? Give it keyboard focus? If so, you can already do that using FlashControl::focus().
It was a good wayUntil we find a better solution, I'll modify HikariManager to allow users to disable the keyboard hook and directly inject keyboard/IME events from their window proc.
Hikari believe will be a very good Ogre GUI system, with its perfect, there will be more and more users.[/quote]
- ajs15822
- OGRE Expert User
- Posts: 570
- Joined: Mon Jan 02, 2006 2:05 am
- Location: Texas
- x 2
- Contact:
Ahh, okay, I will think about adding this too.jianfei5 wrote:setEnable the usefulness lies in the fact that we may use the background image, if we use a FlashControl as a background image, when the mouse click on it, we do not have to put it on top of the screen, so obscured by other windows.What would "setEnable" do? Give it keyboard focus? If so, you can already do that using FlashControl::focus().
Also, Revision 10 has just been committed to the SVN trunk:
ChangeLog wrote:API Changes since v0.2:
- In FlashControl:
-- FlashControl::getUVScale has been added
- In HikariManager:
-- HikariManager::injectKeyEvent has been added
-- HikariManager::setKeyboardHookEnabled has been added
Core Changes since v0.2:
- As a workaround for better IME support, you may now disable the internal keyboard-hook and inject keyboard/IME messages directly from the main window's WindowProc. (thanks to jianfei5)
-
- Gnoblar
- Posts: 10
- Joined: Thu Dec 28, 2006 7:52 am
Viewport to match the monitor size
Hi,
I am using Hikari in my game, manage to learn much actionscript 3.0 for last 2 weeks. My monitor screen is 1024 x 768 size, but the moment I display on a wide screen, it does not fix to the screen.
Can you tell me how will I be able to change the screen size in code to fix all monitor screens?
Thanks in advance for your help.
I am using Hikari in my game, manage to learn much actionscript 3.0 for last 2 weeks. My monitor screen is 1024 x 768 size, but the moment I display on a wide screen, it does not fix to the screen.
Can you tell me how will I be able to change the screen size in code to fix all monitor screens?
Thanks in advance for your help.
-
- Gnoblar
- Posts: 2
- Joined: Sun Jun 22, 2008 11:32 pm
- ajs15822
- OGRE Expert User
- Posts: 570
- Joined: Mon Jan 02, 2006 2:05 am
- Location: Texas
- x 2
- Contact:
You're welcome.eeenmachine wrote:First of all I love you for enabling me to help out on my brother's game Zero Gear! We're having a problem playing dynamically loaded sounds using Sound.load() and Sound.play(). Any ideas?
What seems to be the problem-- is it just not playing?
I just tested the following code out ("nyan nyan.mp3" resides within the same directory as the SWF) and it works just fine:
Code: Select all
var sndRequest:URLRequest = new URLRequest("nyan nyan.mp3");
var sound:Sound = new Sound();
sound.load(sndRequest);
play_btn.addEventListener(MouseEvent.CLICK, function()
{
sound.play();
});
-
- Gnoblar
- Posts: 2
- Joined: Sun Jun 22, 2008 11:32 pm
-
- Greenskin
- Posts: 102
- Joined: Tue May 10, 2005 11:42 pm
- Location: SF, California
- Contact: