A key setting method, wherein the method is performed by a terminal comprising a display screen, a pressure sensing area and a touch sensor, the pressure sensing area is provided on at least one side surface of the terminal with respect to a screen display region, and the display screen is provided on a front surface of the terminal, and the method comprises: detecting a grip posture of a user gripping the terminal by using the touch sensor distributed on a surface of the terminal; determining a key setting mode corresponding to the grip posture, wherein the key setting mode indicates functions of keys, wherein the keys are on a target side surface of the at least one side surface, wherein the target side surface is perpendicular to a surface where the screen display region is located and the keys are operable even after the terminal is in a screen-locked state, and determining the key setting mode corresponding to the grip posture comprises: determining an application program running in a foreground in the terminal; and determining the key setting mode for the target side surface according to the application program running in the foreground and the grip posture; and setting a pressure sensing key corresponding to a key function in the pressure sensing area on the target side surface, wherein before determining the key setting mode corresponding to the grip posture, the method further comprises: displaying a function setting interface corresponding to the key setting mode; and according to a function selection operation performed on the function setting interface, setting the key function corresponding to the target side surface. detecting a grip posture of a user gripping the terminal by using the touch sensor distributed on a surface of the terminal; determining a key setting mode corresponding to the grip posture, wherein the key setting mode indicates functions of keys, wherein the keys are on a target side surface of the at least one side surface, wherein the target side surface is perpendicular to a surface where the screen display region is located and the keys are operable even after the terminal is in a screen-locked state, and determining the key setting mode corresponding to the grip posture comprises: determining an application program running in a foreground in the terminal; and determining the key setting mode for the target side surface according to the application program running in the foreground and the grip posture; and determining an application program running in a foreground in the terminal; and determining the key setting mode for the target side surface according to the application program running in the foreground and the grip posture; and setting a pressure sensing key corresponding to a key function in the pressure sensing area on the target side surface, wherein before determining the key setting mode corresponding to the grip posture, the method further comprises: displaying a function setting interface corresponding to the key setting mode; and according to a function selection operation performed on the function setting interface, setting the key function corresponding to the target side surface. displaying a function setting interface corresponding to the key setting mode; and according to a function selection operation performed on the function setting interface, setting the key function corresponding to the target side surface.