pressing shift and one of editgo keys for win32 version

This commit is contained in:
Ianos Gnatiuc 2005-10-06 17:50:55 +00:00
parent 9815a5db1a
commit 7c5e65cfcd
4 changed files with 54 additions and 5 deletions

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ Win32 version: pressing SHIFT+EditGo* keys will work as EditBlock* keys
! Added Microsoft Developer Studio 6.0 Workspace and GoldEd Project files ! Added Microsoft Developer Studio 6.0 Workspace and GoldEd Project files
(use golded.dsw to open workspace) (use golded.dsw to open workspace)

View File

@ -33,6 +33,8 @@
#include <golded.h> #include <golded.h>
#include <geedit.h> #include <geedit.h>
gkey kbxget_raw(int mode);
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Globals // Globals
@ -1205,7 +1207,7 @@ void IEclass::GoWordRight() {
if((col >= currline->txt.length()) or (currline->txt[col] == '\n')) { if((col >= currline->txt.length()) or (currline->txt[col] == '\n')) {
if(currline->next) { if(currline->next) {
GoDown(); GoDown();
col = 0; col = mincol;
} }
} }
else { else {
@ -1232,11 +1234,11 @@ void IEclass::GoWordRight() {
else else
col--; col--;
} }
if(blockcol != -1)
displine(currline, row);
} }
if (blockcol != -1)
displine(currline, row);
GFTRK(NULL); GFTRK(NULL);
} }
@ -2349,6 +2351,9 @@ int IEclass::handlekey(gkey __key) {
case KK_EditBlockPgDn: __key = KK_EditGoPgDn; break; case KK_EditBlockPgDn: __key = KK_EditGoPgDn; break;
case KK_EditBlockPgUp: __key = KK_EditGoPgUp; break; case KK_EditBlockPgUp: __key = KK_EditGoPgUp; break;
case KK_EditBlockWordRight: __key = KK_EditGoWordRight; break;
case KK_EditBlockWordLeft: __key = KK_EditGoWordLeft; break;
case KK_EditCopy: case KK_EditCopy:
case KK_EditCut: case KK_EditCut:
case KK_EditDelete: goto noselecting; case KK_EditDelete: goto noselecting;
@ -2588,9 +2593,14 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
vcurlarge(); vcurlarge();
gkey _ch; gkey _ch;
gkey keystatus = 0;
do { do {
_ch = getxchtick(); _ch = getxchtick();
// TO_PORT_TAG: kbxget_raw(3)
#if defined(__WIN32__)
keystatus = kbxget_raw(3);
#endif
if(EDIT->AutoSave()) { if(EDIT->AutoSave()) {
time_t _thistime = time(NULL); time_t _thistime = time(NULL);
@ -2611,6 +2621,32 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
gkey _kk = SearchKey(_ch, EditKey, EditKeys); gkey _kk = SearchKey(_ch, EditKey, EditKeys);
if(_kk) { if(_kk) {
_ch = _kk; _ch = _kk;
// TO_PORT_TAG: kbxget_raw(3)
#if defined(__WIN32__)
if (keystatus & SHIFT_PRESSED)
#else
if (0)
#endif
{
switch(_ch)
{
case KK_EditGoUp: _ch = KK_EditBlockUp; break;
case KK_EditGoDown: _ch = KK_EditBlockDown; break;
case KK_EditGoLeft: _ch = KK_EditBlockLeft; break;
case KK_EditGoWordLeft: _ch = KK_EditBlockWordLeft; break;
case KK_EditGoRight: _ch = KK_EditBlockRight; break;
case KK_EditGoWordRight: _ch = KK_EditBlockWordRight; break;
case KK_EditGoBegLine:
case KK_EditGoTopMsg: _ch = KK_EditBlockHome; break;
case KK_EditGoEOL:
case KK_EditGoBotMsg: _ch = KK_EditBlockEnd; break;
case KK_EditGoPgUp:
case KK_EditGoTopLine: _ch = KK_EditBlockPgUp; break;
case KK_EditGoPgDn:
case KK_EditGoBotLine: _ch = KK_EditBlockPgDn; break;
}
}
} }
else { else {
ismacro = IsMacro(_ch, KT_E); ismacro = IsMacro(_ch, KT_E);

View File

@ -174,6 +174,8 @@ const gkey KK_EditBlockPgUp = 0xFF02;
const gkey KK_EditDelete = 0xFF03; const gkey KK_EditDelete = 0xFF03;
const gkey KK_EditUndo = 0xFF04; const gkey KK_EditUndo = 0xFF04;
const gkey KK_EditDeleteSOL = 0xFF05; const gkey KK_EditDeleteSOL = 0xFF05;
const gkey KK_EditBlockWordLeft = 0xFF06;
const gkey KK_EditBlockWordRight = 0xFF07;
const gkey KK_EditSCodeNormal = 0xFF08; const gkey KK_EditSCodeNormal = 0xFF08;
const gkey KK_EditSCodeBold = 0xFF09; const gkey KK_EditSCodeBold = 0xFF09;
const gkey KK_EditSCodeItalic = 0xFF0A; const gkey KK_EditSCodeItalic = 0xFF0A;

View File

@ -1046,6 +1046,7 @@ gkey kbxget_raw(int mode) {
// =2 - return Shifts key status // =2 - return Shifts key status
gkey k; gkey k;
// TO_PORT_TAG: kbxget_raw(3)
#if defined(__USE_NCURSES__) #if defined(__USE_NCURSES__)
int key; int key;
@ -1242,8 +1243,12 @@ gkey kbxget_raw(int mode) {
INPUT_RECORD inp; INPUT_RECORD inp;
DWORD nread; DWORD nread;
static gkey KeyCtrlState = 0;
if(mode == 2) { if (mode == 3) {
return KeyCtrlState;
}
else if(mode == 2) {
return 0; return 0;
} }
else if(mode & 0x01) { else if(mode & 0x01) {
@ -1559,6 +1564,10 @@ gkey kbxget_raw(int mode) {
} }
#endif #endif
// TO_PORT_TAG: kbxget_raw(3)
#if defined(__WIN32__)
KeyCtrlState = (gkey)inp.Event.KeyEvent.dwControlKeyState;
#endif
return k; return k;
} }