焦点返回到编辑器中单击MAC的浮动窗口的按钮后, [英] Return focus to Editor after clicking a button in floating window of MAC

查看:468
本文介绍了焦点返回到编辑器中单击MAC的浮动窗口的按钮后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Adobe Flex的创建了一个虚拟键盘库。

I have created a virtual keyboard library in adobe flex.

我已经创建了一个ANE让Windows在上面,不作为焦点始终将keyboad。使用:

I have already created an ANE for Windows to set the keyboad always on top and non focusable. Using:

int exstyle = GetWindowLong(hwnd3, GWL_EXSTYLE);
exstyle |= WS_EX_NOACTIVATE; 

但现在我要创建一个ANE为Mac(OS 10.7)

But now I have to create an ANE for the mac (OS 10.7)

  1. 我必须从正在运行的Flex应用程序访问键盘(keywindow)
  2. 总在最前面和非可聚焦(即使我按一下键或选择键盘语言键盘的组合框也不会得到聚焦)设置它。因此,光标会一直停留在编辑器中。

我已经通过测试样本的MAC应用程序(仅用于测试目的)


I have tested a sample mac application (for testing purpose only) by using

setLevel:NSFloatingWindowLevel 

然而,当我点击它是没有得到聚焦(光标停留在我的编辑器/ textarea的),但是当我点击任何按钮就可以了该按钮得到重点关注。窗口的空白区域

However when I click on the blank area of the window it is not getting focused (cursor stays in my editor/textarea), but when I click on any button on it that button get focused.

如何进入柔性虚拟键盘并将其设置为无激活模式在Mac

How to access the flex virtual keyboard and set it to No-Activate mode in Mac

------------------------------ ADDED ---------------- ----------------------------------------

------------------------------ADDED--------------------------------------------------------

我已经使用这个code设置我的Flex应用程序的所有窗口的顶部NSWindow

I have used this code to set my Flex application at top of all windows NSWindow

*myMainWindow = [[[NSApplication sharedApplication] windows] objectAtIndex:0];
//[myMainWindow setLevel:NSFloatingWindowLevel]; 
[myMainWindow setLevel:NSMainMenuWindowLevel+1]; 

不过,我想停用窗口,以便它不会集中。像KeyboardViewer在Mac。该KeyEvent应该被重定向到当前的TextInput的关键(Flex的键盘)的每一次点击。

But I want to deactivate that window so that it won't get focused. like KeyboardViewer in mac. The KeyEvent should be redirected to the current TextInput for every click of the key(Flex Keyboard).

请帮我看看你的建议。

推荐答案

你是说你创造了键盘的应用程序,试图窗口转换的ANE?一个ANE似乎是要走的路,除非你可以配置Flex应用程序来创建它的主窗口作为NSPanel,而不是一个NSWindow。

Are you saying you created an ANE in the keyboard app that is trying to convert the Window? An ANE seems to be the way to go unless you can configure the flex application to create its main window as an NSPanel instead of an NSWindow.

你可以做的就是创建一个面板相同大小的窗口,然后设置面板的内容视图窗口的内容视图。这将移动所有窗口的内容,新创建的面板。然后调用orderOut在主窗口和makeKeyAndOrderFront在面板上。这是类似code我们在连接:

What you can do is create a panel the same size as the window then set the panel's content view to the window's content view. That will move all the window's contents to your newly created panel. Then call orderOut on the main window and makeKeyAndOrderFront on the panel. Here is similar code we had in Connect:

NSWindow *mainWindow = [[NSApp windows] objectAtIndex: 0];
NSView *mainContentView = [mainWindow contentView];

NSPanel *mainPanel = [[NSPanel alloc] initWithContentRect:[mainContentView frame]
                 styleMask:NSBorderlessWindowMask | NSNonactivatingPanelMask
                backing:NSBackingStoreBuffered defer:YES];

[mainPanel setContentView:mainContentView];
[mainPanel setLevel:NSScreenSaverWindowLevel];

[mainPanel makeKeyAndOrderFront:nil];
[mainContentView orderOut:nil];

这篇关于焦点返回到编辑器中单击MAC的浮动窗口的按钮后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆