A photosensitive field-effect transistor which can be configured to provide an electrical response when illuminated by electromagnetic radiation incident on the transistor, wherein the photosensitive field-effect transistor comprises: - at least one electrically conducting source electrode and at least one electrically conducting drain electrode , - a layer of two-dimensional material which forms a horizontal transistor channel configured to transport current between the at least one source electrode and the at least one drain electrode , - at least one horizontal electrically conducting first gate electrode which overlies or underlies the transistor channel on a first side of the transistor channel , and at least one gate-insulating layer between the first gate electrode and the transistor channel , - a horizontal photoactive layer with a first horizontal surface and a second horizontal surface, wherein at least a part of the first horizontal surface of the photoactive layer is in contact with a second side of the transistor channel , and the area of the second horizontal surface is a photoactive area, and the photoactive layer can be configured to donate charge carriers to the transistor channel when electromagnetic radiation is absorbed in the photoactive layer , wherein the photosensitive field-effect transistor also comprises a second gate electrode which is in contact with the second horizontal surface of the photoactive layer on one or more contact areas, characterized in that the one or more contact areas form a contact pattern on the second horizontal surface of the photoactive layer so that the total area of the one or more contact areas is a pattern area, and the ratio between the pattern area and the photoactive area is in the range 1% - 50%. - at least one electrically conducting source electrode and at least one electrically conducting drain electrode , - a layer of two-dimensional material which forms a horizontal transistor channel configured to transport current between the at least one source electrode and the at least one drain electrode , - at least one horizontal electrically conducting first gate electrode which overlies or underlies the transistor channel on a first side of the transistor channel , and at least one gate-insulating layer between the first gate electrode and the transistor channel , - a horizontal photoactive layer with a first horizontal surface and a second horizontal surface, wherein at least a part of the first horizontal surface of the photoactive layer is in contact with a second side of the transistor channel , and the area of the second horizontal surface is a photoactive area, and the photoactive layer can be configured to donate charge carriers to the transistor channel when electromagnetic radiation is absorbed in the photoactive layer , wherein the photosensitive field-effect transistor also comprises a second gate electrode which is in contact with the second horizontal surface of the photoactive layer on one or more contact areas, characterized in that the one or more contact areas form a contact pattern on the second horizontal surface of the photoactive layer so that the total area of the one or more contact areas is a pattern area, and the ratio between the pattern area and the photoactive area is in the range 1% - 50%. <EOS>