## Python <s>418</s> <s>351</s> <s>314</s> <s>300</s> 288 Bytes ##

Edit: Saved <s>67</s> <s>104</s> <s>118</s> 130 Bytes thanks to the advice in the comments

    from win32api import*
    from msvcrt import*
    s=137
    G=GetSystemMetrics
    S=SetCursorPos
    x=G(0)//2
    y=G(1)//2
    c=3**.5
    Y=y-2*s/c
    S((x,y))
    while 1:
     a,b=GetCursorPos();S((min(max(a,x-s),x+s),min(max(b,int(c*a+Y-c*x),int(-c*a+Y+c*x)),int(y+s/c))))
     if kbhit()and ord(getch())==27:break

Written in Python 3.4.1 on Windows, pywin needs to be installed.

My first code golf submission. Please feel free to suggest improvements