We selected a large sample of O-B stars that were considered as (candidate) slowly pulsating B, beta Cep, and Maia stars after the analysis of their Hipparcos data. We analysed both the Hipparcos data and our new seven passband Geneva data collected for these stars during the first three years of scientific operations of the Mercator telescope. We performed a frequency analysis for 28 targets with more than 50 high-quality Mercator observations to improve their variability classification. We searched for frequencies by using two independent frequency analysis methods and we applied a 3.6 S/N-level criterion to locate the significant peaks in the periodograms. In total we detected 60 frequencies, among which 32 new ones. We classified 21 objects as pulsating variables (7 new confirmed pulsating stars, including 2 hybrid beta Cep/SPB stars), 6 as non-pulsating variables (binaries or spotted stars), and 1 as photometrically constant stars. For the 27 confirmed variable stars in our sample, we give the values and the corresponding standard errors of the accepted frequencies, the amplitudes, the phases, the constant terms, and the residual standard deviations as found in the seven filters of the Geneva photometric system and in the Hp filter of the Hipparcos photometric system by fitting the data with a superposition of sinusoidal models with reference epoch HJD=2450000.