When developing pocketed macOS version of the input method,I encountered such a problem,That is the window priority issues。Before How to make NSWindow displayed in a different Space or the Screen This article I referred to himself realizes candidate field pocketed input method,In fact, with a NSWindow Implementation。So since it is a common (through the magic change) of [crayon-67251c626b5ed54463[……]
Development on mobile phone,Currently popular on the network mainly two development software,Is a well-known unity (after all, the year 4399 above the game online edition of Minecraft developed by it,3d engine without any software beyond it),Another is the relatively small minority of the cocos。cocos occupy a major position 2d game,And unity has occupied a major position 3d game。And we are talking about the same as coronasdk and cocos 2d game engine (coronasdk not been known before 2010 mainly due to charges[……]
Recently received a project,Demand is to do a special project Andrews board serial read and write in order to achieve some specific external devices to interact with - yes you read right,Andrews is also a board can have serial port!
Many friends do mobile development may not come into contact with - in fact, before I did not come into contact with。He stepped on seven or eight hours a pit,Finally climb out,Here to do a summary,Each board may project different circumstances,We must improvise。
First of all you need to know
Jumper,In order to save the project board USB interface,The default external USB interfaces are not connected to the computer debugging[……]
Excellent input method,We came another excellent platform!
Although it lacks many features,But I can not wait to share these good things to you,He pocketed finally embarked on the input method macOS,over the years,Enter Larry is a nightmare in macOS,Now,This nightmare can end up。
In addition to incomplete abandoned pit I do not know when it can not be used palms input method for Mac、An outer substantially non-professionals can not be input with the Rime,You have one more choice,Pocketed input macOS version。
When the Ins and Outs of six months[……]
Some time ago I said ISave for a black high with apples,It was using an ordinary 1080p display,mine 21:9 To colleagues spent。
Now,I can not stand this 16:9,So he and I changed next,I go back to my 21:9,The results did not expect ...... Nima does not even support!
I heard hd530 drive nuclear significant not OK not result in recognition ......
In short,We still have a way to get the,Experienced a struggle most of the night,got the answer,The first is the splash screen,As shown below,把 Screen Reso[……]
RIP
Here the record about how I did it so that blog suddenly becomes black and white,Go one by one and replaced with a modified theme picture element must be a terrible way,I, of course, is global css style files,Use css itself functions can be realized black and white gray scale rendering。
Add the following code in Wordpress theme built additional css saved to take effect,If you are a static website,Then put the very beginning of the sentence added to your website style。
1 2 3 4 5 6 7 8 9 10 |
html { filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: url(desaturate.svg#grayscale); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(1); } |
[……]
When developing pocketed input method,I met such a thing,That is, as a candidate bar window will go beyond the screen when the edge of the screen! and so,In the display window when I do extra check the coordinates:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
if visiableCandidateCells.isEmpty { if let screenframe = NSScreen.main?.visibleFrame { if screenframe.width < location.x + size.width { location.x -= location.x + size.width - screenframe.width } } } else { if let screenframe = NSScreen.main?.visibleFrame { if screenframe.width < location.x + self.window!.frame.size.width { location.x -= location.x + self.window!.frame.size.width - screenframe.width } } } if location.y < 50 { location.y += 35 + 35 } |
In short,That is, if you count the coordinates of their width exceeds the width of the screen,Norway put it back。
but,Such treatment does not work well in a multi-monitor,This case, since the multi display coordinate caused:
macOS multi-display coordinate Mechanism
[……]
Among write off the grid input method the Mac version of the process,I encountered such a problem,Article candidate system API disrepair,Many API functions exists but is essentially useless,such as:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
/*! @method @abstract Sets the "style" attributes for the candidates window. The keys for the attributes dictionary and the values are: NSFontAttributeName (value = NSFont) Setting the font attribute sets the font that is used to draw Candidates. It does not effect the selection keys which are always drawn in the same font. Note that to set the font size you should use this key/value pair. IMKCandidatesOpacityAttributeName (value = NSNumber with a float value between 0 and 1). Sets the opacity level to transparent (0.0) to completely opaque (1.0). The default opacity is 1.0. This constant is declared above. NSForegroundColorAttributeName (value = NSColor) Sets the text color used for the candidate text. By default it is black. NSBackgroundColorDocumentAttribute (value = NSColor). Set the background color that is drawn behind the candidate text. IMKCandidatesSendServerKeyEventFirst (value = NSNumber). NO (default) gives the candidate window first chance at key events. YES causes events to first be routed to the current IMKInputController. In that case, if the event is not handled, it will then be sent to the candidate window. */ open func setAttributes(_ attributes: [AnyHashable : Any]!) |
This method is used to set the style of a candidate bar,In addition to the default inside IMKCandidatesSendServerKeyEventFirst This can take effect outside,The other not ignore。
This awkward,Now flat out score easily 4k or to Watch[……]
In the Swift,We often used to initialize a URL path,For example, links to web pages。For example, this:
1 2 3 4 5 6 |
…… @IBAction func goToWeb(_ sender: NSButton) { let url = URL(string: "https://v2mm.tech/category/80/logcg-input-method") NSWorkspace.shared.open(url!) } …… |
When the user clicks the button (for example, the Help button),Then all of a sudden will help the user to open the default browser,And opens the specified page (here's a forum)。
Then,If this is your link: "https://How gracefully v2mm.tech/topic/618/ use pocketed input method dashed function" Then it is unfortunate,collapse。
collapse[……]