# How do I get my screencast keys to stay by my world axes when I open & close my Tools panel?

How do I get my screencast keys to stay by my world axes when I open & close my Tools panel? I don't want them to stay out in the middle of the screen when I close my Tools if I'm doing a screencast.

Here's another scenario I want to avoid: having the screencast keys beneath the Tools panel:

• The only way is to edit space_view3d_screencast_keys.py accordingly. The script doesnt look for the width of the tools panel yet. This would be needed to calculate its relative position towards the panel. The problem is, that there is currently no nice way to know the maximum width of the panel when it is hidden. Though you can access its width through context.area.regions. I didnt look deeper for now so i dont consider this a satisfying answer yet. – user2859 Mar 23 '14 at 23:06

I was slightely confused by your question, since you didnt mention that you are using non-default settings.

Easy solution:

Disable "Region Overlap" in "User Preferences - System"

Fix:

If you want to use "Region Overlap" here is a small hackish patch to space_view3d_screencast_keys.py that should roughly do what you want:

def getDisplayLocation(context):
scene   = context.scene
mouse_size = scene.screencast_keys_mouse_size

tool = context.area.regions[1] #coughs.. we just assume its there
w = 0
if bpy.context.user_preferences.system.use_region_overlap:
w = tool.width

pos_x = int( (context.region.width  - mouse_size * MOUSE_RATIO) * \
scene.screencast_keys_pos_x / 100 + w)
pos_y = int( (context.region.height - mouse_size) *
scene.screencast_keys_pos_y / 100)

return(pos_x, pos_y)


Whole file is here: space_view3d_screencast_keys.py

Just find your scripts/addons folder, move the old file and place this one there.

Slightly safer might be to query for the tools panel but it comes with some overhead:

w = 0
for region in context.area.regions:
if region.type == 'TOOLS' and bpy.context.user_preferences.system.use_region_overlap:
w = region.width
break

• Thanks! I had no idea Region Overlap would do that...good to know. – Thom Blair III Mar 24 '14 at 16:18
• Yes it isnt obvious. Thats why the devs of the addon forgot to check for it i guess. Did you try the fix and does it work for you? – user2859 Mar 24 '14 at 16:32
• Actually, I didn't try the code. I just went with putting the screencast keys in the middle of the screen (as shown below) since I thought they would obscure less of the viewport there when long commands are used (like SHIFT+D). But I'm very glad I learned about the effect of Region Overlap. – Thom Blair III Mar 24 '14 at 17:12

Since it does not seem to be possible to have the screencast display stay by the axes, I decided to put them in the middle of the screen. That way, they won't be obscured by the Tools or Properties panels: