From 65ab38fc1c26bed356fc61dd4adfe1f0495fab65 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 17 Jan 2015 15:33:32 +0000 Subject: Clear a selection after it has been copied, as per the AmigaOS Style Guide --- amiga/gui.c | 4 +++- amiga/tree.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index b24ae1c88..6f2f402e8 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1207,7 +1207,6 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie) break; case 'c': nskey = KEY_COPY_SELECTION; - /**\todo this should also send KEY_CLEAR_SELECTION */ break; case 'v': nskey = KEY_PASTE; @@ -2393,6 +2392,9 @@ static void ami_handle_msg(void) ami_help_open(AMI_HELP_GUI, scrn); break; } + } else if(nskey == KEY_COPY_SELECTION) { + /* if we've copied a selection we need to clear it - style guide rules */ + browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION); } } break; diff --git a/amiga/tree.c b/amiga/tree.c index 75ba123ad..e44c821e0 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -1183,6 +1183,10 @@ BOOL ami_tree_event(struct treeview_window *twin) GetAttr(WINDOW_InputEvent,twin->objects[OID_MAIN],(ULONG *)&ie); nskey = ami_key_to_nskey(storage, ie); tree_keypress(twin->tree, nskey); + if(nskey == KEY_COPY_SELECTION) { + /* if we've copied a selection we need to clear it - style guide rules */ + tree_keypress(twin->tree, KEY_CLEAR_SELECTION); + } break; case WMHI_MENUPICK: -- cgit v1.2.3