Skip to content

Instantly share code, notes, and snippets.

@chmnoh
chmnoh / unordmap.cpp
Created February 11, 2017 12:51
unordered_map test
#include <iostream>
#include <string>
#include <unordered_map>
int main()
{
std::string name;
std::unordered_map<int,int> mymap;
mymap.insert(std::make_pair<int,int>(1229,1));
mymap.insert(std::make_pair<int,int>(8,0));
@chmnoh
chmnoh / window.c.patch
Created October 13, 2016 14:32
putty IME patch
diff -r cd645c82db8b -r 7384a4f0d802 windows/window.c
--- a/windows/window.c Thu Oct 23 16:17:24 2014 +0900
+++ b/windows/window.c Wed Sep 09 16:49:18 2015 +0900
@@ -3509,6 +3509,14 @@
* WARNING: Spans over multiple CASEs
*/
case WM_KEYDOWN:
+ if (wParam == VK_ESCAPE) {
+ HIMC hImc = ImmGetContext(hwnd);
+ if (ImmGetOpenStatus(hImc)) {
@chmnoh
chmnoh / gui_w48.c.patch
Last active October 13, 2016 14:40
gvim IME patch
// if press ESC, change mode to ENG
...
if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
{
vk = (int) msg.wParam;
if (vk == VK_ESCAPE) {
HIMC hImc = ImmGetContext(s_hwnd);
if (ImmGetOpenStatus(hImc)) {
ImmSetConversionStatus(hImc, IME_CMODE_ALPHANUMERIC, IME_SMODE_NONE);
ImmReleaseContext(s_hwnd, hImc);