In answer to a question along similar lines, XDA Forum Member AGGevorgyan has developed an that allows Xperia Z owners to easily take photos with the proximity sensor. Designed to rid users of the aforementioned problem, Aqua Z Camera will snap up pictures every time you tap the proximity sensor—simple as that. The sensor sensitivity, being the duration you have your finger covering the proximity sensor, can be adjusted within the app. The great thing is that it doesn’t require root access, meaning its a viable alternative to the physical camera button mod. Despite being in the early alpha stages, AGGevorgyan has already included camera options native to the original camera app, including:
Change camera resolution
Front and back camera compatibility
With four versions currently under the belt, AGGevorgyan warns that Aqua Z Camera may be unstable for some, and will not work with any other device. To learn more, check out the original thread.