[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

[MD:4957] Re: ツールバーボタンの動作について



ちょっと質問。

>>>>> [meadow-users-jp : No.5368] にて
>>>>> "三好" = 私は書きました:
岡村> 例えばショートカットキーに Ctrl + Alt + M を割り当て、Ctrl
岡村> + Alt + M でMeadow2を起動した状態で、ツールバーのボタン(例
岡村> えば、open file)をクリックすると、
岡村> tool-bar C-M-open-file
岡村> とミニバッファに表示され、open file できません。

三好> ;; ショートカットキーというのがあるのですね。知りませんでした。

三好> この不具合が再現することを確認しました。
三好> modifier がおかしくなっているようです。

これなんですけど、mw32_get_keymodifier_state()@mw32term.c の 
GetKeyboradState() で取得するキーの状態がおかしくなっているようで
す。

調べてみたところ、メッセージスレッドの mw32_mouse_button_cc() か
ら呼ばれるときはOK、メインスレッドの 
mw32_process_tool_bar_click() から呼ばれるときはNGでした。

下記の仕様考えると、GetKeyboradState() は必ずメッセージスレッドで
呼ぶように変更すべきなんでしょうか?
キーイベントを処理しているのはメッセージスレッドですので。

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference/KeyboardInputFunctions/GetKeyboardState.asp

> An application can call this function to retrieve the current
> status of all the virtual keys. The status changes as a thread
> removes keyboard messages from its message queue. The status
> does not change as keyboard messages are posted to the thread's
> message queue, nor does it change as keyboard messages are
> posted to or retrieved from message queues of other
> threads. (Exception: Threads that are connected through
> AttachThreadInput share the same keyboard state.)

--
三好 雅則 mailto:miyoshi@xxxxxxxxxxx
          http://www.boreas.dti.ne.jp/~miyoshi/