Implementing a custom hard sigmoid function
Based on this post, hard-sigmoid in Keras is implemented as 
max(0, min(1, x*0.2 + 0.5)). To obtain the graph you like you have to tweak the shift and slope parameters, i.e. leave them out in your case:

$$
max(0, min(1, x))
$$

This will generate following graph:



For Keras' TensorFlow backend you can find the implementation here.
This would be the corresponding changed "hard-sigmoid", for your case:

zero = _to_tensor(0., x.dtype.base_dtype)
one = _to_tensor(1., x.dtype.base_dtype)
x = tf.clip_by_value(x, zero, one)
return x