made ctrl+space operator find and autocomplete in the console, need a bette way to make these key bindings co-exist.
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_screen_set", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1);
WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", UPARROWKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", DOWNARROWKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", SPACEKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_screenshot", F3KEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_screencast", F3KEY, KM_PRESS, KM_ALT, 0);
#include "UI_interface.h"
#include "UI_resources.h"
-//#include "console_intern.h"
+#include "console_intern.h"
static void console_font_begin(SpaceConsole *sc)
{
struct ConsoleLine;
struct wmOperatorType;
struct ReportList;
+struct bContext;
/* console_draw.c */
void console_text_main(struct SpaceConsole *sc, struct ARegion *ar, struct ReportList *reports);
/* console_ops.c */
void console_history_free(SpaceConsole *sc, ConsoleLine *cl);
void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl);
-ConsoleLine *console_history_add_str(const bContext *C, char *str, int own);
-ConsoleLine *console_scrollback_add_str(const bContext *C, char *str, int own);
+ConsoleLine *console_history_add_str(const struct bContext *C, char *str, int own);
+ConsoleLine *console_scrollback_add_str(const struct bContext *C, char *str, int own);
-ConsoleLine *console_history_verify(const bContext *C);
+ConsoleLine *console_history_verify(const struct bContext *C);
int console_report_mask(SpaceConsole *sc);
ConsoleLine *cl;
- for(cl= sc->scrollback.last; cl; cl= cl->prev) {
+ for(cl= sc->scrollback.first; cl; cl= cl->next) {
BLI_dynstr_append(buf_dyn, cl->line);
BLI_dynstr_append(buf_dyn, "\n");
}
console_scrollback_add_str(C, "Cursor: Left/Right Home/End", 0);
console_scrollback_add_str(C, "Remove: Backspace/Delete", 0);
console_scrollback_add_str(C, "Execute: Enter", 0);
- console_scrollback_add_str(C, "Autocomplete: Ctrl+Enter", 0);
+ console_scrollback_add_str(C, "Autocomplete: Ctrl+Space", 0);
console_scrollback_add_str(C, "Ctrl +/- Wheel: Zoom", 0);
console_scrollback_add_str(C, "Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.ui", 0);
}
WM_keymap_add_item(keymap, "CONSOLE_OT_exec", PADENTER, KM_PRESS, 0, 0);
//WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", TABKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
- WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", RETKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
+ WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
#endif
/* report selection */
return OPERATOR_CANCELLED;
}
+/* op->poll */
+int wm_search_menu_poll(bContext *C)
+{
+ if(CTX_wm_window(C)==NULL) return 0;
+ if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
+ return 1;
+}
+
static void WM_OT_search_menu(wmOperatorType *ot)
{
ot->name= "Search Menu";
ot->invoke= wm_search_menu_invoke;
ot->exec= wm_search_menu_exec;
- ot->poll= WM_operator_winactive;
+ ot->poll= wm_search_menu_poll;
}
/* debug/testing */
WM_keymap_verify_item(keymap, "WM_OT_ten_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_search_menu", FKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, KM_CTRL, 0);
}