<script>
GoFullscreen();
location.reload(); // Browser automatically goes out of fullscreen on this
</script>
Run Code Online (Sandbox Code Playgroud)
如果我在网页中使用此代码,它将全屏显示,刷新,并且浏览器会因为刷新而自动退出全屏。我需要代码进入全屏和刷新,而不会退出全屏模式。
<script>
GoFullscreen();
RefreshPage(); // Refreshes the page without going out of fullscreen
</script>
Run Code Online (Sandbox Code Playgroud)
沿着这些路线的东西
如果你想知道为什么我想刷新页面这样的,这是周围的工作我其他的问题在这里,除非我得到一个答案在那里。如果有人知道如何在画布上重新加载数据处理源,那么我就不需要它了。否则刷新整个页面是我知道重新加载数据处理源的唯一方法。
我正在开发一个自定义的“灯箱”照片库。我正在添加关键事件“侦听器”(左>上一个,右>下一个,esc>关闭),我遇到了 Safari(或任何全屏模式浏览器)退出全屏模式的问题。我的网站工作正常,只是查看器必须恢复 Safari(和其他人)的全屏模式。
现在,我知道有一种方法可以绕过这个。例如,在“剧院”模式下查看照片时,可以使用 esc 键关闭 Facebook,而不会导致我的浏览器退出全屏模式。
有什么想法吗?
我正在使用 pygame 模块制作游戏,但现在遇到了问题。该程序本身运行良好,但我想启用的全屏模式不起作用。我为全屏模式制作了一个测试程序,效果很好,但是当我尝试使游戏全屏时,显示效果很奇怪。首先程序启动。您可以看到它进入全屏模式并显示一条文字:“正在加载...”然后窗口消失并以原始的非全屏大小重新出现。屏幕底部的资源管理器栏双显示,然后 2e 资源管理器栏消失。然后游戏以非全屏模式运行。这是我使用的程序:
import pygame, sys, os
from pygame.locals import *
pygame.mixer.pre_init(44100, -16, 4, 2048)
pygame.init()
DISPLAYSURF = pygame.display.set_mode((476, 506), FULLSCREEN)
pygame.display.set_caption('Title of the game')
DISPLAYSURF.fill((128,128,128))
FONT = pygame.font.Font('freesansbold.ttf',20)
LoadingText = FONT.render('Loading...', True, (0,255,0))
LoadingRect = LoadingText.get_rect()
LoadingRect.center = (238,253)
DISPLAYSURF.blit(LoadingText, LoadingRect)
pygame.display.update()
# These files will be created when needed. They are now removed to prevent interference later.
try:
os.remove('LOAD.txt')
except IOError:
pass
try:
os.remove('OPEN.txt')
except IOError:
pass
try:
os.remove('RUN.txt')
except IOError:
pass
try:
os.remove('TEMP.txt')
except IOError: …Run Code Online (Sandbox Code Playgroud) 是否可以将应用程序从非全屏切换到全屏?

我有这个开关,我想让它在打开应用程序时隐藏状态栏,关闭应用程序时不会隐藏状态栏
所以我实现了这个:
@IBAction func fsChanged(sender: AnyObject) {
if(fullScreenSwitch.on)
{
prefersStatusBarHidden()
println("FS attivato")
}
else {
prefersStatusBarHidden()
println("FS disattivato")
}
}
override func prefersStatusBarHidden() -> Bool {
if(fullScreenSwitch.on)
{
return true
}
else {
return false
}
}
Run Code Online (Sandbox Code Playgroud)
它确实适用于实际的转场,但不适用于整个应用程序!我怎样才能为所有应用程序做到这一点?
谢谢!
I am using xmonad and I am unable to get Chromium to display videos in fullscreen.
It was my impression that the following would create a very basic Manage Hook that would detect fullscreen applications and make the window fullscreen and floating:
myManageHook = composeAll [ manageDocks
, manageHook defaultConfig
, (isFullscreen --> doFullFloat) ]
Run Code Online (Sandbox Code Playgroud)
NOTE: This does require xmonad-contrib, which I have. The issue is that a YouTube video in chromium will not fill to fit the entire screen …
我在 iOS 移动设备(iPhone 和 iPad,所有版本)上的 web 应用程序中遇到全屏模式问题。
我有一个按钮可以调用切换全屏功能。此功能适用于除 iOS 以外的所有设备。
我的功能:
function toggleFullScreen(e) {
if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement && !window.navigator.standalone) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
document.documentElement.msRequestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
$('body').css({'height': screen.height});
fullSreen = true;
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) …Run Code Online (Sandbox Code Playgroud) 我想检测是否使用 HTML5 启用了 fullsceen 模式fullscreen API。我正在使用Chrome和Angular 4.x。
我创建了一个 Angular 组件并添加了以下内容@HostListener:
@HostListener('document:webkitfullscreenchange', [$event])
FSHandler(event: KeyboardEvent) {
console.log('fullscreen mode changed...');
}Run Code Online (Sandbox Code Playgroud)
由于某种原因,这不起作用。我试过删除浏览器前缀,捕获其他事件,如webkitFullscreenEnabled,但所有这些都没有帮助。
有什么建议?谢谢。
我有一个非常奇怪的keyUp事件行为。附上JS片段。在 Chrome/Chromium 上测试。
重现步骤:
结果 - 控制台中没有输出行!这是为什么?我希望看到一些东西,但似乎退出全屏会禁用未来的 keyUp 事件。在我的情况下,我通过按一个键开始工作,并且需要在释放后停止它。目前它继续运行。
问题是 - 我如何让它工作?
这可能是 Chrome/Chromium 的错误吗?我现在已经尝试过 Firefox - keyup事件已成功触发。
i = 0;
window.addEventListener("keyup", function() {
console.log("key up, " + i);
i = i+1;
});Run Code Online (Sandbox Code Playgroud)
对于我的生活,我似乎无法得到这方面的帮助。我有一个 JavaFX 屏幕,我想在我的第二台显示器上全屏显示。我根据其他建议尝试了以下方法,但无济于事。我知道坐标是正确的,但它在我的主显示器上保持全屏显示。请帮忙。
if (mainSet.getBoolean("fullScr", false)) {
int count = mainSet.getInt("MonSel", 0);
if (count > 0) {
int i = 0;
for (Screen screen: Screen.getScreens()) {
if (count == i) {
Rectangle2D bounds = screen.getBounds();
primaryStage.setX(bounds.getMinX());
System.out.println(bounds.getMinX());
System.out.println(bounds.getMinY());
primaryStage.setY(bounds.getMinY());
}
i++;
}
}
primaryStage.setFullScreen(true);
}
Run Code Online (Sandbox Code Playgroud)
第一个if检查首选项以查看是否设置了全屏。第二个if查看是否选择了第一个监视器之外的另一个监视器。它是 1,所以它应该是第二个显示器。程序循环遍历所有屏幕并尝试移动程序,然后将全屏显示。我知道坐标是一样的,但没有骰子,它仍然在主屏幕上全屏显示。请帮忙。
我使用 i3 窗口管理器并有
set $Locker i3lock --color=000000 && sleep 1
exec --no-startup-id xautolock -time 5 -locker "$Locker"
Run Code Online (Sandbox Code Playgroud)
在其配置文件中,以便它在 5 分钟后锁定。
问题是,即使我正在观看视频,5 分钟计时器也会倒计时,我绝对不喜欢。(顺便说一句,我通常使用 看电影mplayer,但有时我也会使用 访问流媒体网站qutebrowser。)相反,我想xautolock在这种情况下阻止s 操作。
我想到的一种可能的解决方案是将第二行更改为
exec --no-startup-id myscript -time 5 -locker "$Locker"
Run Code Online (Sandbox Code Playgroud)
这里myscript是一个bash /任何脚本/程序通过了所有选项,xautolock只如果我不看一些视频的东西。但我不知道用这个假设的脚本检查什么。