<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Send Unicode]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13643&amp;type=atom" />
	<updated>2018-04-21T10:10:39Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13643</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Send Unicode]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124840#p124840" />
			<content type="html"><![CDATA[<p>Был уверен, что какой-то простой способ есть, но не вспонил. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-21T10:10:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124840#p124840</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Send Unicode]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124837#p124837" />
			<content type="html"><![CDATA[<p>А зачем так сложно?<br /></p><div class="codebox"><pre><code>f1::
send, {U+1F4B8}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-04-21T09:01:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124837#p124837</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Send Unicode]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124834#p124834" />
			<content type="html"><![CDATA[<p>Можно через буфер обмена:<br /></p><div class="codebox"><pre><code>symHex := { MoneyWithWings: &quot;D83DDCB8&quot;
          , Dizzy:          &quot;D83DDCAB&quot;
          , Flag:           &quot;D83DDEA9&quot; }

$F1::
   if SetUnicodeFromHexToClipboard(symHex.MoneyWithWings)
      Send, ^{vk56}
   Return
   
$F2::
   if SetUnicodeFromHexToClipboard(symHex.Dizzy)
      Send, ^{vk56}
   Return
   
$F3::
   if SetUnicodeFromHexToClipboard(symHex.Flag)
      Send, ^{vk56}
   Return

SetUnicodeFromHexToClipboard(hex)  {
   static GMEM_ZEROINIT := 0x40, GMEM_MOVEABLE := 0x2, CF_UNICODETEXT := 13
   if mod(StrLen(hex), 4) || RegExMatch(hex, &quot;i)[^\dA-F]&quot;)  {
      MsgBox, Wrong hex!
      Return
   }
   if !DllCall(&quot;OpenClipboard&quot;, Ptr, A_ScriptHwnd)  {
      MsgBox, Failed to open Clipboard!
      Return
   }
   DllCall(&quot;EmptyClipboard&quot;)
   hMem := DllCall(&quot;GlobalAlloc&quot;, UInt, GMEM_ZEROINIT|GMEM_MOVEABLE, Ptr, StrLen(hex)//2 + 2, Ptr)
   pMem := DllCall(&quot;GlobalLock&quot;, Ptr, hMem, Ptr)
   
   while str := SubStr(hex, 1 + (A_Index - 1)*4, 4)
      NumPut(&quot;0x&quot; . str, pMem + (A_Index - 1)*2, &quot;UShort&quot;)
   
   DllCall(&quot;GlobalUnlock&quot;, Ptr, hMem)
   res := DllCall(&quot;SetClipboardData&quot;, UInt, CF_UNICODETEXT, Ptr, hMem, Ptr)
   DllCall(&quot;CloseClipboard&quot;)
   if !res  {
      MsgBox, Failed to set data to Clipboard!
      Return
   }
   Return true
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-21T03:19:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124834#p124834</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Send Unicode]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124832#p124832" />
			<content type="html"><![CDATA[<p>Привет народ.<br />Есть такая задача, заставить выводить unicode символы, пример - <a href="https://emojipedia.org/money-with-wings/">https://emojipedia.org/money-with-wings/</a></p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-20T22:26:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124832#p124832</id>
		</entry>
</feed>
