Lacaille改造
GPL
2.2.2
本家の2.3をマージした: v3
---
code:objc
code:objc
enum {
KANA_NO_SHIFT,
KANA_L_THUMB,
KANA_R_THUMB,
KANA_OUTER_SHIFT,
ASCII_NO_SHIFT,
ASCII_OUTER_SHIFT,
WITH_MODIFIER,
ASCII_L_THUMB,
ASCII_R_THUMB
};
code:objc
static CGKeyCode viewTable[] = {
6, 7, 8, 9, 11, 45, 46, 43, 47, 44, LAYOUT_KEY_COUNT - 1, // 94
0, 1, 2, 3, 5, 4, 38, 40, 37, 41, 39, 42,
12, 13, 14, 15, 17, 16, 32, 34, 31, 35, 33, 30,
18, 19, 20, 21, 23, 22, 26, 28, 25, 29, 27, 24, LAYOUT_KEY_COUNT - 2 // 93
};
これは文字キーを下段から書いたもの
94: kVK_JIS_Underscore
93: kVK_JIS_Yen: 0x5D
code:objc
static inline void startTimer(NSTimeInterval negativeInterval) {
NSTimeInterval interval = prefTwait - negativeInterval;
gTimer = [NSTimer scheduledTimerWithTimeInterval:(interval >= 0 ? interval : 0)
target:self_
selector:@selector(timerFired:)
userInfo:(__bridge id)nil
repeats:NO];
}
static inline void fireTimer() {
}
を
[
$
a{{{{{{
asdfhgzx
code:objc
// 同時判定時間を過ぎていたら親指キーを戻す
if (!prefCshift && (gBuff == prefThumbL || gBuff == prefThumbR) &&
[NSDate date timeIntervalSinceDate:gOyaKeyDownTimeStamp] > prefTwait) { unsigned char prevBuff = gBuff;
CGEventFlags prevEventMasks = gEventMasks;
switch(gBuff) {
case kVK_Option:
case kVK_RightOption:
gEventMasks &= ~kCGEventFlagMaskAlternate; break;
case kVK_Command:
case kVK_RightCommand:
gEventMasks &= ~kCGEventFlagMaskCommand; break;
case kVK_Shift:
case kVK_RightShift:
gEventMasks &= ~kCGEventFlagMaskShift; break;
case kVK_CapsLock:
gEventMasks &= ~kCGEventFlagMaskAlphaShift; break;
case kVK_Control:
gEventMasks &= ~kCGEventFlagMaskControl; break;
}
startTimer(0);
fireTimer();
// 親指が修飾キーなら親指キーではなく修飾キーとしてもう一度押す
if (prevEventMasks != gEventMasks) {
myCGEventPostToPid(targetPid, CGEventCreateKeyboardEvent(source, prevBuff, YES));
// yield しないと順序が逆になる
NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05f;
}
}