The real hotkeys didn't match the ones written in the menus.

I made the hotkey match the menu entry (I could have done the other way around, but the hotkeys in the menu were more consistant and logical than the real ones).

Also started cleaning hotkey management in this file. The even is splitted in two switch with some events being catched in both. This creates some strange double event catching sometimes. I'll be fixing that this afternoon (school time now).
This commit is contained in:
Martin Poirier 2004-01-19 16:33:06 +00:00
parent 81d9e52e20
commit f7d5c46e53

@ -1089,7 +1089,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} else if (val) { } else if (val) {
switch (event) { switch (event) {
case FKEY: case FKEY:
if ((G.qual & LR_ALTKEY) && (G.qual & LR_SHIFTKEY)) { if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3"); p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3");
switch(p) { switch(p) {
@ -1129,7 +1129,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case EKEY: case EKEY:
if (G.qual & LR_ALTKEY && G.qual & LR_SHIFTKEY) { if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
p= pupmenu("Edit %t|" p= pupmenu("Edit %t|"
"Cut %x0|" "Cut %x0|"
"Copy %x1|" "Copy %x1|"
@ -1156,7 +1156,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case VKEY: case VKEY:
if (G.qual & LR_ALTKEY && G.qual & LR_SHIFTKEY) { if (G.qual == (LR_ALTKEY| LR_SHIFTKEY)) {
p= pupmenu("View %t|" p= pupmenu("View %t|"
"Top of File %x0|" "Top of File %x0|"
"Bottom of File %x1|" "Bottom of File %x1|"
@ -1189,7 +1189,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case SKEY: case SKEY:
if (G.qual & LR_ALTKEY && G.qual & LR_SHIFTKEY) { if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
p= pupmenu("Select %t|" p= pupmenu("Select %t|"
"Select All %x0|" "Select All %x0|"
"Select Line %x1|" "Select Line %x1|"
@ -1241,7 +1241,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case DKEY: case DKEY:
if (G.qual & LR_CTRLKEY) { if (G.qual == LR_CTRLKEY) {
txt_delete_char(text); txt_delete_char(text);
do_draw= 1; do_draw= 1;
pop_space_text(st); pop_space_text(st);
@ -1249,7 +1249,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case EKEY: case EKEY:
if (G.qual & LR_CTRLKEY) { if (G.qual == LR_CTRLKEY) {
txt_move_eol(text, G.qual & LR_SHIFTKEY); txt_move_eol(text, G.qual & LR_SHIFTKEY);
do_draw= 1; do_draw= 1;
pop_space_text(st); pop_space_text(st);
@ -1257,26 +1257,26 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case JKEY: case JKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
do_draw= jumptoline_interactive(st); do_draw= jumptoline_interactive(st);
} }
break; break;
case OKEY: case OKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs); activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
} }
break; break;
case MKEY: case MKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
txt_export_to_object(text); txt_export_to_object(text);
do_draw= 1; do_draw= 1;
} }
break; break;
case NKEY: case NKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
st->text= add_empty_text(); st->text= add_empty_text();
st->top= 0; st->top= 0;
@ -1287,18 +1287,14 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case PKEY: case PKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
run_python_script(st); run_python_script(st);
do_draw= 1; do_draw= 1;
} }
break; break;
case RKEY: case RKEY:
if (G.qual & LR_ALTKEY) { if (G.qual == LR_ALTKEY) {
txt_do_redo(text);
do_draw= 1;
}
if (G.qual & LR_CTRLKEY) {
if (text->compiled) BPY_free_compiled_text(text); if (text->compiled) BPY_free_compiled_text(text);
text->compiled = NULL; text->compiled = NULL;
if (okee("Reopen Text")) { if (okee("Reopen Text")) {
@ -1321,13 +1317,14 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case UKEY: case UKEY:
if (G.qual & LR_ALTKEY) {
if (G.qual & LR_SHIFTKEY) txt_do_redo(text);
//txt_print_undo(text); //debug buffer in console //txt_print_undo(text); //debug buffer in console
else { if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
txt_do_undo(text); txt_do_redo(text);
do_draw= 1; do_draw= 1;
} }
if (G.qual == LR_ALTKEY) {
txt_do_undo(text);
do_draw= 1;
} }
break; break;
@ -1344,7 +1341,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case XKEY: case XKEY:
if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) { if (G.qual == LR_ALTKEY || G.qual == LR_CTRLKEY) {
txt_cut_sel(text); txt_cut_sel(text);
do_draw= 1; do_draw= 1;
pop_space_text(st); pop_space_text(st);