简体   繁体   English

在Linux中用C模拟F11键

[英]Simulating F11 key in C in linux

I need to know how to simulate the F11 key, which toggles the gnome-terminal's console window to full screen in Linux. 我需要知道如何模拟F11键,该键在Linux中将gnome-terminal的控制台窗口切换为全屏。

The OS I am using Linux Mint 14 (based on Ubuntu 12.10) and using gcc compiler. 我正在使用Linux Mint 14(基于Ubuntu 12.10)和gcc编译器的操作系统。 The program is written in C 该程序用C语言编写

I have looked for this in other places but it is most things are for windows. 我在其他地方寻找过这个东西,但是大多数东西都在窗户上。

Thanks! 谢谢!

You can resize many terminals (from within the terminal) by using the escape sequence: 您可以使用转义序列来调整许多终端的大小(从终端内部):

ESC [ 4 ; ESC [ 4 ; height ; 高度; width t 宽度t

In C, this would look like: 在C中,这看起来像:

printf("\e[4;%d;%dt", height, width);

There's no straightforward way to determine the maximum usable size. 没有直接的方法来确定最大可用大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM