Lots of updates:
1. Scrolling and click to set the cursor works. 2. GUI now uses Brass Mono as the font. 3. A lot of stability and other updates.
This commit is contained in:
40
KKeymap.cc
Normal file
40
KKeymap.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "KKeymap.h"
|
||||
|
||||
|
||||
auto
|
||||
KLookupKCommand(const int ascii_key, const bool ctrl, CommandId &out) -> bool
|
||||
{
|
||||
// Normalize to lowercase letter if applicable
|
||||
int k = KLowerAscii(ascii_key);
|
||||
|
||||
if (ctrl) {
|
||||
switch (k) {
|
||||
case 'x':
|
||||
out = CommandId::SaveAndQuit;
|
||||
return true; // C-k C-x
|
||||
case 'q':
|
||||
out = CommandId::Quit;
|
||||
return true; // C-k C-q (quit immediately)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (k) {
|
||||
case 's':
|
||||
out = CommandId::Save;
|
||||
return true; // C-k s
|
||||
case 'e':
|
||||
out = CommandId::OpenFileStart;
|
||||
return true; // C-k e (open file)
|
||||
case 'x':
|
||||
out = CommandId::SaveAndQuit;
|
||||
return true; // C-k x
|
||||
case 'q':
|
||||
out = CommandId::Quit;
|
||||
return true; // C-k q
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user